|
IBM Branch Transformation Toolkit Javadoc | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.btt.base.DataElement
com.ibm.btt.base.DataCollection
com.ibm.btt.base.KeyedCollection
Instances of this class contain data elements ordered by insertion or definition. This class provides a protocol for accessing the data elements by name or by position, and for changing and removing these elements.
Field Summary | |
---|---|
protected Hashtable |
elements
|
protected Hashtable |
nestedElements
|
(package private) int |
nextItem
|
protected java.util.Vector |
order
|
Fields inherited from class com.ibm.btt.base.DataElement |
---|
description, externalizer, name, parameters, state |
Constructor Summary | |
---|---|
KeyedCollection()
This is the default constructor used to create a KeyedCollection object. |
|
KeyedCollection(int hsize,
int vsize)
This is the constructor used to create a KeyedCollection object . |
|
KeyedCollection(java.lang.String aName)
This is the constructor used by the externalizer used to create a KeyedCollection object. |
Method Summary | |
---|---|
void |
addElement(DataElement aDataElement)
Add an entry to the hashtable of elements using as key the dataElement name. |
void |
addElement(java.lang.String aName,
java.lang.Object aValue,
java.lang.String aPath,
java.lang.String aType)
Adds a data element (instance of aType) to the KeyedCollection when the dynamic behavior is active. |
Hashtable |
calculeNestedElements()
Gets the nested elements property (java.util.Hashtable) value. |
Hashtable |
calculeNestedQualifiedElements()
Returns a Hashtable with the elements present at any level of this KeyedCollection. |
java.lang.Object |
clone()
Returns a new KeyedCollection cloned from the current one |
java.lang.String |
getDynamic()
Gets the dynamic property (String) value. |
DataElement |
getElementAt(int index)
Returns the value of the element located at the index position. |
DataElement |
getElementAt(java.lang.String aName)
Returns the data element identified by its name. |
DataElement |
getElementAtAnyLevel(java.lang.String aName)
Returns the first element that matches aName at any level of depth of the keyedCollection. |
protected DataElement |
getElementAtFirstLevel(java.lang.String aName)
Returns the element that matches aName. |
Hashtable |
getElements()
Gets the elements property (java.util.Hashtable) value. |
java.util.Enumeration |
getEnumeration()
Returns the elements of the keyedCollection as an Enumeration. |
int |
getIndexOf(int from,
java.lang.String aName)
Returns the position of the element aName. |
int |
getIndexOf(java.lang.String aName)
Returns the position of the element aName. |
Hashtable |
getNestedElements()
Gets the nested elements property (java.util.Hashtable) value. |
Hashtable |
getOrder()
Gets the order property (java.util.Hashtable) value. |
java.util.Vector |
getOrderVector()
Gets the order property (java.util.Vector) value. |
java.lang.Object |
getValue()
Returns the elements of the keyedCollections. |
java.lang.Object |
initializeFrom(Tag aTag)
Initialize a keyedCollection from its tag in XML. |
boolean |
isDynamic()
Returns the boolean value of the dynamic property. |
void |
readExternal(java.io.ObjectInput s)
Invokes the object creation from an ObjectInput. |
void |
removeAll()
Removes all elements of the keyedCollection. |
DataElement |
removeElementAt(int index)
Removes the element at the index indicated by the index parameter. |
DataElement |
removeElementAt(java.lang.String aName)
Removes the named data element. |
protected DataElement |
removeElementAtFirstLevel(java.lang.String aName)
Removes the element identified by aName. |
protected void |
reorderElements(int from)
Reorders all the elements from the index indicated by the from parameter to the last element. |
void |
setDynamic(boolean aValue)
Sets the dynamic property value. |
void |
setDynamic(java.lang.String aValue)
Sets the dynamic property (java.lang.String) value. |
void |
setElements(Hashtable anElements)
Sets the elements property (java.util.Hashtable) value. |
void |
setOrder(Hashtable anOrder)
Sets the order property (java.util.Vector) value from a Hashtable. |
void |
setOrder(java.util.Vector anOrder)
Sets the order property (java.util.Hashtable) value. |
void |
setValue(java.lang.Object aValue)
Sets the value to the KeyedCollection from a Hashtable. |
void |
setValueAt(java.lang.String aName,
java.lang.Object aValue)
This method calls the addElement method to create the DataElement aName with the value aValue. |
void |
setValueAt(java.lang.String aName,
java.lang.Object aValue,
java.lang.String aType)
Calls the addElement() method to create the aName DataElement (instance of aType) with its value set to aValue. |
int |
size()
Returns the number of elements in the keyedCollection. |
static java.lang.String |
stringValueOf(int i)
Returns the String of _stringValueOfInt[] using the relevant index. |
java.lang.String |
toString()
Returns a visual representation of the keyedCollection. |
Vector |
toStrings()
Returns a visual representation of the keyedCollection. |
DataElement |
tryGetElementAt(java.lang.String aName)
Returns the data element identified by its name. |
DataElement |
tryGetElementAtAnyLevel(java.lang.String aName)
Returns the first element that matches aName at any level of depth of the keyedCollection. |
protected DataElement |
tryGetElementAtFirstLevel(java.lang.String aName)
Returns the element that matches aName. |
java.lang.Object |
tryGetValueAt(java.lang.String aCompositeKey)
Returns the value of an element located in the path aCompositeKey. |
int |
trySetValueAt(java.lang.String aName,
java.lang.Object aValue)
This method call the addElement method to create the DataElement aName with the value aValue. |
void |
writeExternal(java.io.ObjectOutput s)
Provides concrete serialization handling for KeyedCollection. |
Methods inherited from class com.ibm.btt.base.DataCollection |
---|
getValueAt, nestedElements, nestedElements, nestedFields, nestedKeyedCollections, nestedQualifiedElements, validate |
Methods inherited from class com.ibm.btt.base.DataElement |
---|
externalizer, getCompositeKey, getDescription, getDescriptor, getErrorInfo, getExternalizer, getKey, getName, getParameter, getParameters, getState, getTagName, isAmended, isCached, isSerializable, readExternal, readObject, removeExternal, setAmended, setCompositeKey, setDescription, setDescriptor, setErrorInfo, setExternalizer, setIsCached, setName, setParameter, setParameters, setSerializable, setState, toTags, validate, validateObject, writeExternal |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
int nextItem
protected Hashtable elements
protected Hashtable nestedElements
protected java.util.Vector order
Constructor Detail |
public KeyedCollection()
public KeyedCollection(int hsize, int vsize)
public KeyedCollection(java.lang.String aName) throws java.io.IOException
aName
- java.lang.StringMethod Detail |
public void addElement(DataElement aDataElement)
aDataElement
- DataElementpublic void addElement(java.lang.String aName, java.lang.Object aValue, java.lang.String aPath, java.lang.String aType) throws DSEInvalidArgumentException, java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
aName
- java.lang.String. - The Name of the DataElementaValue
- Object. - The Value of the DataElementaPath
- java.lang.String. - The Path to the DataElementaType
- java.lang.String - The Type of the DataElement
DSEInvalidArgumentException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
public Hashtable calculeNestedElements()
public Hashtable calculeNestedQualifiedElements()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface DSECloneable
clone
in class DataElement
java.lang.CloneNotSupportedException
public java.lang.String getDynamic()
setDynamic(java.lang.String)
public DataElement getElementAt(int index) throws DSEObjectNotFoundException
index
- int
DSEObjectNotFoundException
public DataElement getElementAt(java.lang.String aName) throws DSEObjectNotFoundException
getElementAt
in class DataElement
aName
- java.lang.String the path and name of the data element to be retrieved
DSEObjectNotFoundException
public DataElement getElementAtAnyLevel(java.lang.String aName) throws DSEObjectNotFoundException
aName
- java.lang.String - The name of the data element to be retrieved
DSEObjectNotFoundException
protected DataElement getElementAtFirstLevel(java.lang.String aName) throws DSEObjectNotFoundException
aName
- java.lang.String
DSEObjectNotFoundException
public Hashtable getElements()
setElements(com.ibm.btt.base.Hashtable)
public java.util.Enumeration getEnumeration()
getEnumeration
in class DataCollection
public int getIndexOf(int from, java.lang.String aName)
public int getIndexOf(java.lang.String aName)
public Hashtable getNestedElements()
public Hashtable getOrder()
setOrder(com.ibm.btt.base.Hashtable)
public java.util.Vector getOrderVector()
setOrder(com.ibm.btt.base.Hashtable)
public java.lang.Object getValue()
getValue
in class DataElement
public java.lang.Object initializeFrom(Tag aTag) throws java.io.IOException
aTag
- Tag
java.io.IOException
public boolean isDynamic()
public void readExternal(java.io.ObjectInput s) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
readExternal
in class DataElement
s
- java.io.ObjectInput
java.io.IOException.
java.lang.ClassNotFoundException.
java.io.IOException
java.lang.ClassNotFoundException
public void removeAll()
public DataElement removeElementAt(int index) throws DSEObjectNotFoundException
index
- int
com.ibm.btt.base.DSEObjectNotFoundException.
DSEObjectNotFoundException
public DataElement removeElementAt(java.lang.String aName) throws DSEObjectNotFoundException
removeElementAt
in class DataElement
aName
- java.lang.String
DSEObjectNotFoundException
protected DataElement removeElementAtFirstLevel(java.lang.String aName) throws DSEObjectNotFoundException
aName
- java.lang.String
DSEObjectNotFoundException
protected void reorderElements(int from)
from
- int
DSEObjectNotFoundException
public void setDynamic(java.lang.String aValue)
public void setDynamic(boolean aValue)
public void setElements(Hashtable anElements)
public void setOrder(Hashtable anOrder)
public void setOrder(java.util.Vector anOrder)
anOrder
- - The new value for the propertygetOrder()
public void setValue(java.lang.Object aValue) throws DSEInvalidArgumentException
setValue
in class DataCollection
aValue
- java.lang.Object - Must be a Hastable. The keys are Strings that represent the names of the dataelement
and the values of this keys are the DataElements Objects.
DSEInvalidArgumentException
- - The parameter is not a Hashtable Objectpublic void setValueAt(java.lang.String aName, java.lang.Object aValue) throws DSEInvalidArgumentException, DSEObjectNotFoundException
setValueAt
in class DataCollection
DSEInvalidArgumentException
DSEObjectNotFoundException
public void setValueAt(java.lang.String aName, java.lang.Object aValue, java.lang.String aType) throws DSEInvalidArgumentException, DSEObjectNotFoundException
DSEInvalidArgumentException
com.ibm.btt.base.DSEObjectNotFoundException.
DSEObjectNotFoundException
public int size()
public static java.lang.String stringValueOf(int i)
i
- int
public java.lang.String toString()
public Vector toStrings()
toStrings
in interface Externalizable
toStrings
in class DataElement
public DataElement tryGetElementAt(java.lang.String aName)
tryGetElementAt
in class DataElement
aName
- java.lang.String - The path and name of the data element to be retrieved
public DataElement tryGetElementAtAnyLevel(java.lang.String aName)
aName
- java.lang.String - The name of the data element to be retrieved
protected DataElement tryGetElementAtFirstLevel(java.lang.String aName)
aName
- java.lang.String
public java.lang.Object tryGetValueAt(java.lang.String aCompositeKey)
aCompositeKey
- java.lang.String
public int trySetValueAt(java.lang.String aName, java.lang.Object aValue) throws DSEInvalidArgumentException
com.ibm.btt.base.DSEInvalidArgumentException.
com.ibm.btt.base.DSEObjectNotFoundException.
DSEInvalidArgumentException
public void writeExternal(java.io.ObjectOutput s) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
writeExternal
in class DataElement
s
- java.io.ObjectOutput
java.io.IOException
|
IBM Branch Transformation Toolkit Javadoc | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |