edu.cmu.cs.able.gaugeInfrastructure.util
Class ObjectPairVector

java.lang.Object
  |
  +--edu.cmu.cs.able.gaugeInfrastructure.util.ObjectPairVector
All Implemented Interfaces:
java.io.Serializable

public class ObjectPairVector
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Constructor Summary
ObjectPairVector()
           
 
Method Summary
 void addElement(java.lang.Object name, java.lang.Object value)
          Adds the specified component to the end of this vector, increasing its size by one.
 void addElement(edu.cmu.cs.able.gaugeInfrastructure.util.ObjectPair sp)
          Adds the specified component to the end of this vector, increasing its size by one.
 edu.cmu.cs.able.gaugeInfrastructure.util.ObjectPair elementAt(int index)
          Returns the component at the specified index.
 java.util.Enumeration elements()
           
 java.lang.Object getValue(java.lang.Object name)
          Gets the value of a specified pair in this vector.
 boolean isEmpty()
          Tests if this vector has no components.
 java.lang.Object nameAt(int index)
          Gets the name of a specified pair in this vector.
 void removeAllElements()
          Removes all components from this vector and sets its size to zero.
 void removeElementAt(int index)
          Removes the first (lowest-indexed) occurrence of the argument from this vector.
 void setValue(java.lang.Object name, java.lang.Object value)
          Sets the value of a specified pair in this vector.
 int size()
          Returns the number of components in this vector.
 java.lang.String toString()
          Returns a string representation of this Vector, containing the String representation of each element.
 java.lang.Object valueAt(int index)
          Gets the value of a specified pair in this vector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectPairVector

public ObjectPairVector()
Method Detail

size

public int size()
Returns the number of components in this vector.
Returns:
the number of components in this vector.

isEmpty

public boolean isEmpty()
Tests if this vector has no components.
Returns:
true if and only if this vector has no components, that is, its size is zero; false otherwise.

elements

public java.util.Enumeration elements()

addElement

public void addElement(java.lang.Object name,
                       java.lang.Object value)
Adds the specified component to the end of this vector, increasing its size by one. The capacity of this vector is increased if its size becomes greater than its capacity.
Parameters:
name - the name of the pair to be added.
value - the value of the pair to be added.

addElement

public void addElement(edu.cmu.cs.able.gaugeInfrastructure.util.ObjectPair sp)
Adds the specified component to the end of this vector, increasing its size by one. The capacity of this vector is increased if its size becomes greater than its capacity.
Parameters:
ObjectPair - the pair to be added.

elementAt

public edu.cmu.cs.able.gaugeInfrastructure.util.ObjectPair elementAt(int index)
Returns the component at the specified index.
Parameters:
index - an index into this vector.
Returns:
the pair at the specified index.

removeElementAt

public void removeElementAt(int index)
Removes the first (lowest-indexed) occurrence of the argument from this vector. If the object is found in this vector, each component in the vector with an index greater or equal to the object's index is shifted downward to have an index one smaller than the value it had previously.
Parameters:
index - the index to be deleted.

removeAllElements

public void removeAllElements()
Removes all components from this vector and sets its size to zero.

getValue

public java.lang.Object getValue(java.lang.Object name)
Gets the value of a specified pair in this vector.
Parameters:
name - name of the pair.
Returns:
value of the pair.

setValue

public void setValue(java.lang.Object name,
                     java.lang.Object value)
Sets the value of a specified pair in this vector.
Parameters:
name - name of the pair.
value - value of the pair.

nameAt

public java.lang.Object nameAt(int index)
Gets the name of a specified pair in this vector.

Parameters:
index - index of the pair.
Returns:
name of the pair.

valueAt

public java.lang.Object valueAt(int index)
Gets the value of a specified pair in this vector.

Parameters:
index - index of the pair.
Returns:
value of the pair.

toString

public java.lang.String toString()
Returns a string representation of this Vector, containing the String representation of each element.
Overrides:
toString in class java.lang.Object