edu.washington.cs.supple.rep
Interface VectorType

All Superinterfaces:
ContainerType, SuppleBean, SuppleType
All Known Implementing Classes:
VectorTypeImpl

public interface VectorType
extends ContainerType

Author:
kgajos

Method Summary
 void addValue(StateVar uiObject, java.lang.Object v)
          Adds an element to the vector held by the uiObject
 boolean containsValue(StateVar uiObject, java.lang.Object v)
          Checks if the vector held by the uiObjects contains a particular value
 SuppleType getElementType()
          Returns the type of the elements in this vector
 int getNumValues(StateVar uiObject)
           
 java.lang.Object getValue(StateVar uiObject, int i)
           
 java.util.Vector getValues(StateVar uiObject)
          Returns the value of the uiObject cast as a vector; if the object has no value, an empty vector is returned (never null)
 boolean removeValue(StateVar uiObject, java.lang.Object v)
          Removes a value from the vector held by the uiObject
 void setValue(StateVar uiObject, java.lang.Object value)
          Erases whaver elements that might have been held by the uiObject and sets the value as the only element of the vector
 void setValues(StateVar uiObject, java.util.Collection c)
          Erases whaver elements that might have been held by the uiObject and sets the collection of values as the contents of the vector
 
Methods inherited from interface edu.washington.cs.supple.rep.ContainerType
childrenHaveLabels, getChild, getChildren, getNumChildren, getNumChildrenAdded, getUiObject, hasModifiableChild, removeChild, size, swapChild
 
Methods inherited from interface edu.washington.cs.supple.rep.SuppleType
accept, getIndex, getIndex, getLegalValues, getLikelyValues, getLongestLegalIndex, getMaxNumLegalValues, getNumLegalValues, getNumLikelyValues, getTypicalIndexLength, getUniqueId, hasIndex, hasOrdering, hasSetLegalValues, isEnumerable, isFinalLegalValues, isLegalValue, isLegalValueClass, isPrimitiveType, orderValues, toPrettyString, verifyCurrentValue
 
Methods inherited from interface edu.washington.cs.supple.rep.SuppleBean
addPropertyChangeListener, removePropertyChangeListener
 

Method Detail

getElementType

public SuppleType getElementType()
Returns the type of the elements in this vector

Returns:
the type of the elements in this vector

addValue

public void addValue(StateVar uiObject,
                     java.lang.Object v)
Adds an element to the vector held by the uiObject

Parameters:
uiObject - a ui Element of type VectorType
v - a value to be added to the vector
Throws:
java.lang.IllegalArgumentException - if the value is considered illegal by the type that describes the elements held by this vector

removeValue

public boolean removeValue(StateVar uiObject,
                           java.lang.Object v)
Removes a value from the vector held by the uiObject

Parameters:
uiObject - a ui Element of type VectorType
v - a value to be added to the vector
Returns:
true if the value was contained in the vector, false otherwise

setValue

public void setValue(StateVar uiObject,
                     java.lang.Object value)
Erases whaver elements that might have been held by the uiObject and sets the value as the only element of the vector

Parameters:
uiObject - a ui Element of type VectorType
value - the value to be set

setValues

public void setValues(StateVar uiObject,
                      java.util.Collection c)
Erases whaver elements that might have been held by the uiObject and sets the collection of values as the contents of the vector

Parameters:
uiObject - a ui Element of type VectorType
c - the collection of values

containsValue

public boolean containsValue(StateVar uiObject,
                             java.lang.Object v)
Checks if the vector held by the uiObjects contains a particular value

Parameters:
uiObject - a ui Element of type VectorType
v - value to be checked
Returns:
true if value was found among the elements of the vector; false otherwise

getValues

public java.util.Vector getValues(StateVar uiObject)
Returns the value of the uiObject cast as a vector; if the object has no value, an empty vector is returned (never null)

Parameters:
uiObject - a ui Element of type VectorType
Returns:
a vector of values (it's a clone of the original)

getValue

public java.lang.Object getValue(StateVar uiObject,
                                 int i)

getNumValues

public int getNumValues(StateVar uiObject)