All Packages Class Hierarchy This Package Previous Next Index
Class sics.agentbase.mif.MIFComposite
java.lang.Object
|
+----sics.agentbase.mif.MIFValue
|
+----sics.agentbase.mif.MIFComposite
- public abstract class MIFComposite
- extends MIFValue
This is the base class for all composite MIF types.
A composite MIF type can contain several other MIF values of some
specified type as in, for example, a MIF list or set.
-
MIFComposite()
-
-
addValue(MIFValue)
- Adds a MIF value to the composite value.
-
addValue(Object[])
- Adds several MIF values to the composite value,
by passing them in an array.
-
addValue(String)
- Adds a String value to the composite value.
-
clear()
- Removes all values.
-
getComplexity()
- Returns the complexity of the composite value.
-
insertValueAt(MIFValue, int)
- Inserts a value at the specified position.
-
isMember(MIFValue)
- Returns true if the specified value is a member in the composite value.
-
removeValueAt(int)
- Removes the value at the specified position.
-
setValueAt(MIFValue, int)
- Sets a value at the specified position.
-
size()
- Returns the number of values contained in the composite value.
-
typeCheck(MIFValue)
- Checks if the specified value is of the right type to be added.
-
valueAt(int)
- Returns the value at the specified position.
-
values()
- Returns an enumeration of all values.
MIFComposite
public MIFComposite()
getComplexity
public int getComplexity()
- Returns the complexity of the composite value.
- Returns:
- the complexity of the composite value.
- Overrides:
- getComplexity in class MIFValue
addValue
public void addValue(String value)
- Adds a String value to the composite value.
- Parameters:
- value - - the String value to add.
- Throws: MIFTypeException
- if type error.
addValue
public void addValue(MIFValue value)
- Adds a MIF value to the composite value.
- Parameters:
- value - the MIF value to add.
- Throws: MIFTypeException
- if type error.
addValue
public void addValue(Object values[])
- Adds several MIF values to the composite value,
by passing them in an array.
The values in the array can be Strings or MIFValues.
- Parameters:
- values - an array of MIF values to add.
- Throws: MIFTypeException
- if type error.
size
public int size()
- Returns the number of values contained in the composite value.
- Returns:
- the number of values contained in the composite value.
valueAt
public MIFValue valueAt(int index)
- Returns the value at the specified position.
- Parameters:
- index - index into the composite value.
- Returns:
- the value at the specified position.
removeValueAt
public void removeValueAt(int index)
- Removes the value at the specified position.
- Parameters:
- index - index into the composite value.
insertValueAt
public void insertValueAt(MIFValue v,
int index)
- Inserts a value at the specified position.
- Parameters:
- v - the MIF value to insert.
- index - the position to insert the value at.
- Throws: MIFTypeException
- if type error.
setValueAt
public void setValueAt(MIFValue v,
int index)
- Sets a value at the specified position.
- Parameters:
- v - the value to set.
- index - the position to set the value at.
- Throws: MIFTypeException
- if type error.
clear
public void clear()
- Removes all values.
values
public Enumeration values()
- Returns an enumeration of all values.
- Returns:
- an enumeration of all values.
isMember
public boolean isMember(MIFValue v)
- Returns true if the specified value is a member in the composite value.
- Parameters:
- v - the value to check if it is a member.
- Returns:
- true if the value exists and false otherwise.
typeCheck
public boolean typeCheck(MIFValue value)
- Checks if the specified value is of the right type to be added.
- Parameters:
- value - the value to type check.
- Returns:
- true if the value is of the right type and false otherwise.
- Overrides:
- typeCheck in class MIFValue
All Packages Class Hierarchy This Package Previous Next Index