Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.management.oss
Interface MultiValueList

All Superinterfaces:
  java.lang.Cloneable, java.io.Serializable

public interface MultiValueList
extends java.io.Serializable, java.lang.Cloneable

Base interface for all MultiValueList attributes.

By default no operations on the ManagedEntityValue object are defined for the addition or removal of individual values to multi-valued attributes. If this functionality is required then the multi-valued attribute should be modeled as a MultiValueList object.

Some value objects may require the addition or removal of individual values to multi-valued attributes. For example a Trouble Ticket may contains a large set of Alarms. In oder to minimize the amount of data required to add or remove a single attribute value from a multi-valued attribute associated with a Managed Entity it is recommended to use the following MultiValuedList template:

     public interface <AttributeType>List extends MultiValueList
     {
            public void  add(AttributeType[] attributes)
            throws java.lang.IllegalStateException,
            java.lang.IllegalArgumentException;

            public void remove(AttributeType[] attributes)
            throws java.lang.IllegalStateException,
            java.lang.IllegalArgumentException;

            public void set(AttributeType[] attributes)
            throws java.lang.IllegalStateException,
            java.lang.IllegalArgumentException;

            public <AttributeType>[] get()
            throws java.lang.IllegalStateException;
            //return an exception if modifier is NONE

            public <AttributeType>[] make(int number )
            throws java.lang.IllegalArgumentException;
           //The list is a factory for its elements

     }

The MultiValueList object itself supports the addition, removal and replacement of individual values.

The list can have at most one operation (add, remove,replace) pending.

The `reset()` operation undo any `add()`, `remove()` or `set()` that was done previously and set the modifier value to NONE.

The semantics of the operations are as follows:

- `add()` is used to append values at the end of an existing attribute array.
- `remove()` is used to remove values from an existing list. I.e., each element of the existing list matching (where `AttributeType.equals(AttributeType))` an element of the provided list is removed.
- `set()` is used to replace all the elements of the existing attribute array with the provided elements. I.e., replace all attributes with the provided ones.

A MultiValuedList which contains no elements must be explicitly set with an empty array, and calling `get()` must return an empty array.

Using null in the `set()` operation is prohibited and the IllegalArgumentException should be raised.

Field Summary
`static int` | `ADD` A value of ADD indicates that this object is used to append values at the end of an existing attribute array.
`static int` | `NONE` No modifer is attached to this object.
`static int` | `REMOVE` A value of REMOVE indicates that this object is used to remove values from an existing list.
`static int` | `SET` A value of SET indicates that this object will be used to replace all the elements of the back-end existing attribute array with the provided elements.

Method Summary
`java.lang.Object` | `clone()` Returns a deep copy of this object.
`int` | `getModifier()` Get the value of the current modifier.
`void` | `reset()` Reset the whole object.

Field Detail

### NONE

    public static final int NONE

  No modifer is attached to this object.

  See Also:
    Constant Field Values

### SET

    public static final int SET

  A value of SET indicates that this object will be used to replace all the elements of the back-end existing attribute array with the provided elements. I.e., replace all attributes with the provided ones.

  See Also:
    Constant Field Values

### ADD

    public static final int ADD

  A value of ADD indicates that this object is used to append values at the end of an existing attribute array.

  See Also:
    Constant Field Values

### REMOVE

    public static final int REMOVE

  A value of REMOVE indicates that this object is used to remove values from an existing list. I.e., each element of the existing list matching an element of the provided list is removed from the back-end.

  See Also:
    Constant Field Values

Method Detail

### clone

    public java.lang.Object clone()

  Returns a deep copy of this object.

### getModifier

    public int getModifier()

  Get the value of the current modifier.

### reset

    public void reset()

  Reset the whole object. I.e., set the modifer to NONE and empty the contained array.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD