|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcleoni.adv.ManageableObject
cleoni.adv.Dict
public class Dict
Modified version of the Vector class, so that it works like an associative array. Dictionary object. SETS are Dictionary object. See VBScript documentation on Dictionary objects
| Field Summary | |
|---|---|
protected int |
elementCount
The number of valid components in the vector. |
protected java.lang.Object[] |
elementData
The array buffer into which the components of the vector are stored. |
protected java.lang.String[] |
keys
|
| Fields inherited from class cleoni.adv.ManageableObject |
|---|
methodArgs, methods |
| Constructor Summary | |
|---|---|
Dict()
Constructs an empty vector. |
|
Dict(int initialCapacity)
Constructs an empty vector with the specified initial capacity. |
|
Dict(int initialCapacity,
int capacityIncrement,
boolean areDupsAllowed)
Constructs an empty vector with the specified initial capacity and capacity increment. |
|
| Method Summary | |
|---|---|
int |
capacity()
Returns the current capacity of this vector. |
void |
clear()
Removes all components from this vector and sets its size to zero. |
java.lang.Object |
clone()
Returns a clone of this vector. |
boolean |
containsKey(java.lang.String key)
Tests if the specified object is a component in this vector. |
void |
copyInto(java.lang.Object[] anArray)
Copies the components of this vector into the specified array. |
void |
copyKeysInto(java.util.Vector myvect)
Copies the components of this vector into the specified array. |
java.lang.Object |
elementAt(int index)
Returns the component at the specified index. |
java.util.Enumeration |
elements()
Returns an enumeration of the components of this vector. |
void |
ensureCapacity(int minCapacity)
Increases the capacity of this vector, if necessary, to ensure that it can hold at least the number of components specified by the minimum capacity argument. |
protected void |
ensureCapacityHelper(int minCapacity)
This implements the unsynchronized semantics of ensureCapacity. |
java.lang.Object |
firstElement()
Returns the first component of this vector. |
java.lang.String |
firstKey()
Returns the first component of this vector. |
java.lang.Object |
get(java.lang.String key)
Gets an object |
java.lang.Object |
getIC(java.lang.String key)
|
java.lang.String |
getS(java.lang.String key)
|
int |
indexOf(java.lang.String key)
Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using
the equals method. |
void |
insertElementAt(java.lang.Object obj,
int index)
Inserts the specified object as a component in this vector at the specified index. |
boolean |
isEmpty()
Tests if this vector has no components. |
java.lang.String |
keyAt(int index)
Returns the component at the specified index. |
java.lang.Object |
lastElement()
Returns the last component of the vector. |
java.lang.Object |
lastKey()
Returns the last component of the vector. |
void |
put(java.lang.String key,
java.lang.Object obj)
Adds the specified component to the end of this vector, increasing its size by one. |
boolean |
remove(java.lang.String id)
Removes the first occurrence of the argument from this vector. |
void |
removeAt(int index)
Deletes the component at the specified index. |
void |
setElementAt(java.lang.Object obj,
int index)
Sets the component at the specified index of this
vector to be the specified object. |
void |
setSize(int newSize)
Sets the size of this vector. |
int |
size()
Returns the number of components in this vector. |
java.lang.String |
toSettingsPair(java.lang.String sep)
Returns a string representation of this vector. |
java.lang.String |
toString()
Returns a string representation of this vector. |
void |
trimToSize()
Trims the capacity of this vector to be the vector's current size. |
| Methods inherited from class cleoni.adv.ManageableObject |
|---|
execMethod, getId, getMethodArgs, getMethods, getName, hasMethod, varExists, varGet, varGet |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String[] keys
protected java.lang.Object[] elementData
protected int elementCount
| Constructor Detail |
|---|
public Dict()
public Dict(int initialCapacity)
initialCapacity - the initial capacity of the vector.
public Dict(int initialCapacity,
int capacityIncrement,
boolean areDupsAllowed)
areDupsAllowed - must be True is duplicates are allowedinitialCapacity - the initial capacity of the vector.capacityIncrement - the amount by which the capacity is
increased when the vector overflows.| Method Detail |
|---|
public final int capacity()
public final void clear()
public java.lang.Object clone()
clone in class java.lang.Objectpublic final boolean containsKey(java.lang.String key)
key -
true if the specified object is a component in
this vector; false otherwise.public final void copyInto(java.lang.Object[] anArray)
anArray - the array into which the components get copied.public final void copyKeysInto(java.util.Vector myvect)
anArray - the array into which the components get copied.public final java.lang.Object elementAt(int index)
index - an index into this vector.
public final java.util.Enumeration elements()
Enumerationpublic final void ensureCapacity(int minCapacity)
minCapacity - the desired minimum capacity.protected void ensureCapacityHelper(int minCapacity)
Vector.ensureCapacity(int)
public final java.lang.Object firstElement()
throws java.lang.Exception
NoSuchElementException - if this vector has no components.
java.lang.Exception
public final java.lang.String firstKey()
throws java.lang.Exception
NoSuchElementException - if this vector has no components.
java.lang.Exceptionpublic java.lang.Object get(java.lang.String key)
key - key to be searched
public final java.lang.String getS(java.lang.String key)
public int indexOf(java.lang.String key)
index, and testing for equality using
the equals method.
elem - an object.
index or later in the
vector; returns -1 if the object is not found.Object.equals(java.lang.Object)
public final void insertElementAt(java.lang.Object obj,
int index)
index. Each component in this vector with
an index greater or equal to the specified index is
shifted upward to have an index one greater than the value it had
previously.
The index must be a value greater than or equal to 0
and less than or equal to the current size of the vector.
obj - the component to insert.index - where to insert the new component.
java.lang.ArrayIndexOutOfBoundsException - if the index was invalid.Vector.size()public final boolean isEmpty()
true if this vector has no components;
false otherwise.public final java.lang.String keyAt(int index)
index - an index into this vector.
java.lang.ArrayIndexOutOfBoundsException - if an invalid index was
given.
public final java.lang.Object lastElement()
throws java.lang.Exception
size() - 1.
NoSuchElementException - if this vector is empty.
java.lang.Exception
public final java.lang.Object lastKey()
throws java.lang.Exception
size() - 1.
NoSuchElementException - if this vector is empty.
java.lang.Exception
public void put(java.lang.String key,
java.lang.Object obj)
obj - the component to be added.public final boolean remove(java.lang.String id)
obj - the component to be removed.
true if the argument was a component of this
vector; false otherwise.public final void removeAt(int index)
index is shifted downward to have an index one
smaller than the value it had previously.
The index must be a value greater than or equal to 0
and less than the current size of the vector.
index - the index of the object to remove.
java.lang.ArrayIndexOutOfBoundsException - if the index was invalid.Vector.size()
public final void setElementAt(java.lang.Object obj,
int index)
index of this
vector to be the specified object. The previous component at that
position is discarded.
The index must be a value greater than or equal to 0
and less than the current size of the vector.
obj - what the component is to be set to.index - the specified index.
java.lang.ArrayIndexOutOfBoundsException - if the index was invalid.Vector.size()public final void setSize(int newSize)
null items are added to the end of
the vector. If the new size is less than the current size, all
components at index newSize and greater are discarded.
newSize - the new size of this vector.public final int size()
public final java.lang.String toString()
toString in class ManageableObjectpublic final java.lang.String toSettingsPair(java.lang.String sep)
public final void trimToSize()
public java.lang.Object getIC(java.lang.String key)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||