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.


Constructor Index

 o MIFComposite()

Method Index

 o addValue(MIFValue)
Adds a MIF value to the composite value.
 o addValue(Object[])
Adds several MIF values to the composite value, by passing them in an array.
 o addValue(String)
Adds a String value to the composite value.
 o clear()
Removes all values.
 o getComplexity()
Returns the complexity of the composite value.
 o insertValueAt(MIFValue, int)
Inserts a value at the specified position.
 o isMember(MIFValue)
Returns true if the specified value is a member in the composite value.
 o removeValueAt(int)
Removes the value at the specified position.
 o setValueAt(MIFValue, int)
Sets a value at the specified position.
 o size()
Returns the number of values contained in the composite value.
 o typeCheck(MIFValue)
Checks if the specified value is of the right type to be added.
 o valueAt(int)
Returns the value at the specified position.
 o values()
Returns an enumeration of all values.

Constructors

 o MIFComposite
 public MIFComposite()

Methods

 o getComplexity
 public int getComplexity()
Returns the complexity of the composite value.

Returns:
the complexity of the composite value.
Overrides:
getComplexity in class MIFValue
 o 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.
 o 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.
 o 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.
 o size
 public int size()
Returns the number of values contained in the composite value.

Returns:
the number of values contained in the composite value.
 o 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.
 o removeValueAt
 public void removeValueAt(int index)
Removes the value at the specified position.

Parameters:
index - index into the composite value.
 o 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.
 o 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.
 o clear
 public void clear()
Removes all values.

 o values
 public Enumeration values()
Returns an enumeration of all values.

Returns:
an enumeration of all values.
 o 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.
 o 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