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

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

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

GaugeValueVector provides vector operations using GaugeValue as element data store.

See Also:
Serialized Form

Constructor Summary
GaugeValueVector()
           
 
Method Summary
 void addElement(edu.cmu.cs.able.gaugeInfrastructure.util.GaugeValue sp)
          Add an existing GaugeValue object into the vector
 void addElement(java.lang.String name, java.lang.String property, java.lang.String value)
          Create new gauge value record and add to the vector.
 void copyInto(GaugeValueVector gvv)
          Copy the elements from this into gvv
 edu.cmu.cs.able.gaugeInfrastructure.util.GaugeValue elementAt(int index)
          Returns a GaugeValue at a given index
 java.lang.String getProperty(java.lang.String name)
          Retrieve the name of the proprety that associates with the value.
 java.lang.String getValue(java.lang.String name)
          Retrieve the value represented as String given its value name
 boolean isEmpty()
          Returns whether the vector is empty
 java.lang.String nameAt(int index)
          Retrieve the name of the gauge value at given index
 java.lang.String propertyAt(int index)
          Retrieve the name of property that associates with the gauge value
 void removeAllElements()
          Remove all object in the vector.
 void removeElementAt(int index)
          Remove the GaugaValue object at the given index
 int size()
          Returns the number of elements in this vector
 java.lang.String toString()
          Convert the vector into a string so that it can be printed
 java.lang.String valueAt(int index)
          Retrieve the value of the gauge value at given index
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GaugeValueVector

public GaugeValueVector()
Method Detail

size

public int size()
Returns the number of elements in this vector
Returns:
the number of gauge value records in the vector

isEmpty

public boolean isEmpty()
Returns whether the vector is empty
Returns:
true if no gauge value in the vector, false otherwise.

addElement

public void addElement(java.lang.String name,
                       java.lang.String property,
                       java.lang.String value)
Create new gauge value record and add to the vector.
Parameters:
name - the name of the new gauge value
property - the property name that the gauge value will associate with
value - the actual value represented as String

addElement

public void addElement(edu.cmu.cs.able.gaugeInfrastructure.util.GaugeValue sp)
Add an existing GaugeValue object into the vector
Parameters:
sp - The GaugeValue to be added

elementAt

public edu.cmu.cs.able.gaugeInfrastructure.util.GaugeValue elementAt(int index)
Returns a GaugeValue at a given index
Parameters:
index - the index of the object to be retrieved
Returns:
the GaugeValue object at the given index

removeElementAt

public void removeElementAt(int index)
Remove the GaugaValue object at the given index
Parameters:
index - the index of the object to be removed

removeAllElements

public void removeAllElements()
Remove all object in the vector.

nameAt

public java.lang.String nameAt(int index)
Retrieve the name of the gauge value at given index
Parameters:
index - the index of the object
Returns:
the gauge value's name

valueAt

public java.lang.String valueAt(int index)
Retrieve the value of the gauge value at given index
Parameters:
index - the index of the object
Returns:
the gauge value's value

propertyAt

public java.lang.String propertyAt(int index)
Retrieve the name of property that associates with the gauge value
Parameters:
index - the index of the object
Returns:
the gauge value's value

getValue

public java.lang.String getValue(java.lang.String name)
Retrieve the value represented as String given its value name
Parameters:
name - the name of the gauge value
Returns:
the value represented as String

getProperty

public java.lang.String getProperty(java.lang.String name)
Retrieve the name of the proprety that associates with the value.
Parameters:
name - the name of the gauge value
Returns:
the name of the associated property

copyInto

public void copyInto(GaugeValueVector gvv)
Copy the elements from this into gvv
Parameters:
gvv - the GaugeValueVector to copy into

toString

public java.lang.String toString()
Convert the vector into a string so that it can be printed
Overrides:
toString in class java.lang.Object
Returns:
the string that represents the GaugeValueVector