|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.digi.config.util.Vector2
Vector2 implements a 2-columns vector object. The 2 columns contain a key and a value similiar to Hashtable, however the entries in a Vector2 object is ordered. Vector2 implements mixed interface definitions like Vector and Hashtable.
Hashtable,
Vector| Constructor Summary | |
Vector2()
Constructs an empty vector. |
|
Vector2(int initialCapacity)
Constructs an empty Vector2 with the specified storage capacity. |
|
Vector2(int initialCapacity,
int capacityIncrement)
Constructs an empty Vector2 with the specified storage capacity and specified capacity increment. |
|
| Method Summary | |
(package private) void |
addElement(java.lang.Object inKey,
java.lang.Object inVal)
Adds the key/value pair as the last elements of the vector. |
int |
capacity()
Returns the current capacity of the vector. |
void |
clear()
Removes all key/value elements in the vector. |
boolean |
contains(java.lang.Object inVal)
Returns true if the collection contains inVal element in the value column. |
boolean |
containsKey(java.lang.Object inKey)
Returns true if the collection contains inKey element in the key column. |
java.util.Enumeration |
elements()
Returns an enumeration of the value elements. |
void |
ensureCapacity(int minCapacity)
Ensures that the vector has at lease the specified capacity. |
java.lang.Object |
get(java.lang.Object inKey)
Gets the value object associated with the specified key in the vector. |
void |
insertElementAt(java.lang.Object inKey,
java.lang.Object inVal,
int index)
Inserts an key/value pair elements at the specified index. |
boolean |
isEmpty()
Returns true if the collection contains no values. |
java.lang.Object |
keyElementAt(int index)
Returns the key element at the specified index. |
int |
keyIndexOf(java.lang.Object inKey)
Searches for the specified key object, starting from the first position and returns and index to it. |
int |
keyLastIndexOf(java.lang.Object inKey)
Searches backward for the specified key object, starting from the last position and returns and index to it. |
java.util.Enumeration |
keys()
Returns an enumeration of the key elements. |
void |
put(java.lang.Object inKey,
java.lang.Object inVal)
Puts the specified value element into the vector, using the specified key. |
boolean |
removeElement(java.lang.Object inKey)
Deletes the key/val elements that matches the inKey. |
void |
removeElementAt(int index)
Deletes the key/val elements at the specified index. |
void |
setElementAt(java.lang.Object inKey,
java.lang.Object inVal,
int index)
Sets the element at the specified index to be the sepcified key/value. |
void |
setSize(int newSize)
Sets the size of the vector. |
int |
size()
Returns the number of elements in the vector. |
java.lang.String |
toString()
|
void |
trimToSize()
Trims the vector's capacity down to size. |
java.lang.Object |
valueElementAt(int index)
Returns the value element at the specified index. |
int |
valueIndexOf(java.lang.Object inVal)
Searches for the specified value object, starting from the first position and returns and index to it. |
int |
valueLastIndexOf(java.lang.Object inVal)
Searches backward for the specified value object, starting from the last position and returns and index to it. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Vector2()
public Vector2(int initialCapacity)
initialCapacity - initial storage capacity of the vector.
public Vector2(int initialCapacity,
int capacityIncrement)
initialCapacity - initial storage capacity of the vector.capacityIncrement - how much to increase the elemnt's size by.| Method Detail |
final void addElement(java.lang.Object inKey,
java.lang.Object inVal)
inKey - the key object to insert at the specified position.inVal - the value object to insert at the specified position.public final int capacity()
public final void clear()
public final boolean contains(java.lang.Object inVal)
inVal - the value to search for.public final boolean containsKey(java.lang.Object inKey)
inKey - the key to search for.public final java.util.Enumeration elements()
public final void ensureCapacity(int minCapacity)
minCapacity - the desired minimum capacity.public final java.lang.Object get(java.lang.Object inKey)
inKey - the key to search for.
public final void insertElementAt(java.lang.Object inKey,
java.lang.Object inVal,
int index)
throws java.lang.ArrayIndexOutOfBoundsException
inKey - the key object to insert at the specified position.inVal - the value object to insert at the specified position.index - the specified index.
java.lang.ArrayIndexOutOfBoundsException - If an invalid index was given.public final boolean isEmpty()
public final java.lang.Object keyElementAt(int index)
throws java.lang.ArrayIndexOutOfBoundsException
index - the index of the desired key object.
java.lang.ArrayIndexOutOfBoundsException - If an invalid index was given.public final int keyIndexOf(java.lang.Object inKey)
inKey - the key object to search.
public final int keyLastIndexOf(java.lang.Object inKey)
inKey - the key object to search.
public final java.util.Enumeration keys()
public final void put(java.lang.Object inKey,
java.lang.Object inVal)
inKey - the specified key in the vector.inVal - the value element to be put.public final boolean removeElement(java.lang.Object inKey)
inKey - the key of the element to be deleted.
public final void removeElementAt(int index)
throws java.lang.ArrayIndexOutOfBoundsException
index - the elements to remove
java.lang.ArrayIndexOutOfBoundsException - If an invalid index was given.
public final void setElementAt(java.lang.Object inKey,
java.lang.Object inVal,
int index)
throws java.lang.ArrayIndexOutOfBoundsException
inKey - the key object to set at the specified position.inVal - the value object to set at the specified position.index - the specified index.
java.lang.ArrayIndexOutOfBoundsException - If an invalid index was given.public final void setSize(int newSize)
newSize - the new size of the vector.public final int size()
public java.lang.String toString()
public final void trimToSize()
public final java.lang.Object valueElementAt(int index)
throws java.lang.ArrayIndexOutOfBoundsException
index - the index of the desired value object.
java.lang.ArrayIndexOutOfBoundsException - If an invalid index was given.public final int valueIndexOf(java.lang.Object inVal)
inVal - the value object to search.
public final int valueLastIndexOf(java.lang.Object inVal)
inVal - the value object to search.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||