addElement(DataElement aDataElement)
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 |
nextItem
int nextItem
elements
protected Hashtable elements
nestedElements
protected Hashtable nestedElements
order
protected java.util.Vector order
DEFAULT_COMPRESSION
public static final byte DEFAULT_COMPRESSION
- See Also:
- Constant Field Values
DEFAULT_BUFFER_SIZE
public static final int DEFAULT_BUFFER_SIZE
- See Also:
- Constant Field Values
bufferSize
protected int bufferSize
KeyedCollection
public KeyedCollection()
- This is the default constructor used to create a KeyedCollection object.
KeyedCollection
public KeyedCollection(int hsize,
int vsize)
- This is the constructor used to create a KeyedCollection object .
KeyedCollection
public KeyedCollection(java.lang.String aName)
throws java.io.IOException
- This is the constructor used by the externalizer used to create a KeyedCollection object.
- Parameters:
aName - java.lang.String
- Throws:
java.io.IOException
addElement
public void addElement(DataElement aDataElement)
- Add an entry to the hashtable of elements using as key the dataElement name.
- Parameters:
aDataElement - DataElement
addElement
public 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
- Adds a data element (instance of aType) to the KeyedCollection when the dynamic behavior is active.
This method adds the element to the position pointed to by the aPath parameter with its initial value set to aValue.
- Parameters:
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
- Throws:
DSEInvalidArgumentException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
calculeNestedElements
public Hashtable calculeNestedElements()
- Gets the nested elements property (java.util.Hashtable) value.
- Returns:
- - The nestedElements property value
calculeNestedQualifiedElements
public Hashtable calculeNestedQualifiedElements()
- Returns a Hashtable with the elements present at any level of this KeyedCollection.
Each entry has as key the qualified name of the DataElement and as value the DataElement object.
- Returns:
- Hashtable
clone
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
- Returns a new KeyedCollection cloned from the current one
- Specified by:
clone in interface DSECloneable - Overrides:
clone in class DataElement
- Returns:
- java.lang.Object
- Throws:
java.lang.CloneNotSupportedException
getDynamic
public java.lang.String getDynamic()
- Gets the dynamic property (String) value.
- Returns:
- The dynamic property value as String
- See Also:
setDynamic(java.lang.String)
getElementAt
public DataElement getElementAt(int index)
throws DSEObjectNotFoundException
- Returns the value of the element located at the index position.
- Parameters:
index - int
- Returns:
- com.ibm.btt.base.DataElement
- Throws:
DSEObjectNotFoundException
getElementAt
public DataElement getElementAt(java.lang.String aName)
throws DSEObjectNotFoundException
- Returns the data element identified by its name. It is found by the path indicated in the aName parameter.
The path is set by identifier strings separated by a period (.).
An asterisk (*) specifies a search in any level of depth in this keyed collection.
- Overrides:
getElementAt in class DataElement
- Parameters:
aName - java.lang.String the path and name of the data element to be retrieved
- Returns:
- DataElement
- Throws:
DSEObjectNotFoundException
getElementAtAnyLevel
public DataElement getElementAtAnyLevel(java.lang.String aName)
throws DSEObjectNotFoundException
- Returns the first element that matches aName at any level of depth of the keyedCollection.
- Parameters:
aName - java.lang.String - The name of the data element to be retrieved
- Returns:
- com.ibm.btt.base.DataElement
- Throws:
DSEObjectNotFoundException
getElementAtFirstLevel
protected DataElement getElementAtFirstLevel(java.lang.String aName)
throws DSEObjectNotFoundException
- Returns the element that matches aName. This method only searches in this first level and
not in other levels.
- Parameters:
aName - java.lang.String
- Returns:
- DataElement
- Throws:
DSEObjectNotFoundException
getElements
public Hashtable getElements()
- Gets the elements property (java.util.Hashtable) value.
- Returns:
- The elements property value
- See Also:
setElements(com.ibm.btt.base.Hashtable)
getEnumeration
public java.util.Enumeration getEnumeration()
- Returns the elements of the keyedCollection as an Enumeration.
- Specified by:
getEnumeration in class DataCollection
- Returns:
- java.util.Enumeration
getIndexOf
public int getIndexOf(int from,
java.lang.String aName)
- Returns the position of the element aName. The search begins at the position indicated by the from parameter.
- Returns:
- int
param from int - The position from which to start the search for the data element
param aName String - The name of the data element to be retrieved
getIndexOf
public int getIndexOf(java.lang.String aName)
- Returns the position of the element aName.
- Returns:
- int
getNestedElements
public Hashtable getNestedElements()
- Gets the nested elements property (java.util.Hashtable) value.
- Returns:
- java.util.Hashtable - The nestedElements property value
getOrder
public Hashtable getOrder()
- Gets the order property (java.util.Hashtable) value.
- Returns:
- java.util.Hashtable - The order property value
- See Also:
setOrder(com.ibm.btt.base.Hashtable)
getOrderVector
public java.util.Vector getOrderVector()
- Gets the order property (java.util.Vector) value.
- Returns:
- java.util.Vector - The order property value
- See Also:
setOrder(com.ibm.btt.base.Hashtable)
getValue
public java.lang.Object getValue()
- Returns the elements of the keyedCollections. This
method is implemented to provide polymorphism.
- Specified by:
getValue in class DataElement
- Returns:
- java.lang.Object
initializeFrom
public java.lang.Object initializeFrom(Tag aTag)
throws java.io.IOException
- Initialize a keyedCollection from its tag in XML.
- Parameters:
aTag - Tag
- Returns:
- java.lang.Object
- Throws:
java.io.IOException
isDynamic
public boolean isDynamic()
- Returns the boolean value of the dynamic property.
- Returns:
- boolean
readExternal
public void readExternal(java.io.ObjectInput s)
throws java.io.IOException,
java.lang.ClassNotFoundException
- Invokes the object creation from an ObjectInput.
- Specified by:
readExternal in interface java.io.Externalizable - Overrides:
readExternal in class DataElement
- Parameters:
s - java.io.ObjectInput
- Throws:
java.io.IOException.
java.lang.ClassNotFoundException.
java.io.IOException
java.lang.ClassNotFoundException
readFromStream
public void readFromStream(java.io.ObjectInput s)
throws java.io.IOException,
java.lang.ClassNotFoundException
- Invokes the object creation from an ObjectInput.
- Parameters:
s - java.io.ObjectInput
- Throws:
java.io.IOException.
java.lang.ClassNotFoundException.
java.io.IOException
java.lang.ClassNotFoundException
removeAll
public void removeAll()
- Removes all elements of the keyedCollection.
removeElementAt
public DataElement removeElementAt(int index)
throws DSEObjectNotFoundException
- Removes the element at the index indicated by the index parameter.
- Parameters:
index - int
- Returns:
- com.ibm.btt.base.DataElement
- Throws:
com.ibm.btt.base.DSEObjectNotFoundException.
DSEObjectNotFoundException
removeElementAt
public DataElement removeElementAt(java.lang.String aName)
throws DSEObjectNotFoundException
- Removes the named data element. It is found by the path indicated in the aName parameter.
The paths are set by identifier strings separated by a period (.).
For security reasons the asterisk (*) is not allowed in the path aName.
- Overrides:
removeElementAt in class DataElement
- Parameters:
aName - java.lang.String
- Returns:
- DataElement
- Throws:
DSEObjectNotFoundException
removeElementAtFirstLevel
protected DataElement removeElementAtFirstLevel(java.lang.String aName)
throws DSEObjectNotFoundException
- Removes the element identified by aName.
- Parameters:
aName - java.lang.String
- Returns:
- DataElement
- Throws:
DSEObjectNotFoundException
reorderElements
protected void reorderElements(int from)
- Reorders all the elements from the index indicated by the from parameter to the last element.
- Parameters:
from - int
- Throws:
DSEObjectNotFoundException
setDynamic
public void setDynamic(java.lang.String aValue)
- Sets the dynamic property (java.lang.String) value.
setDynamic
public void setDynamic(boolean aValue)
- Sets the dynamic property value.
setElements
public void setElements(Hashtable anElements)
- Sets the elements property (java.util.Hashtable) value.
setOrder
public void setOrder(Hashtable anOrder)
- Sets the order property (java.util.Vector) value from a Hashtable.
setOrder
public void setOrder(java.util.Vector anOrder)
- Sets the order property (java.util.Hashtable) value.
- Parameters:
anOrder - - The new value for the property- See Also:
getOrder()
setValue
public void setValue(java.lang.Object aValue)
throws DSEInvalidArgumentException
- Sets the value to the KeyedCollection from a Hashtable. This method
first initializes the KeyedCollection and then, with the value of the parameter, gives
a new value to the KeyedCollection. The nextItem, elements, netedElements and order attributes are modified.
- Overrides:
setValue in class DataCollection
- Parameters:
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.
- Throws:
DSEInvalidArgumentException - - The parameter is not a Hashtable Object
setValueAt
public void setValueAt(java.lang.String aName,
java.lang.Object aValue)
throws DSEInvalidArgumentException,
DSEObjectNotFoundException
- This method calls the addElement method to create
the DataElement aName with the value aValue.
- Overrides:
setValueAt in class DataCollection
- Throws:
DSEInvalidArgumentException
DSEObjectNotFoundException
setValueAt
public void setValueAt(java.lang.String aName,
java.lang.Object aValue,
java.lang.String aType)
throws DSEInvalidArgumentException,
DSEObjectNotFoundException
- Calls the addElement() method to create the aName DataElement (instance of aType) with its value set to aValue.
- Throws:
DSEInvalidArgumentException
com.ibm.btt.base.DSEObjectNotFoundException.
DSEObjectNotFoundException
size
public int size()
- Returns the number of elements in the keyedCollection.
- Returns:
- int
stringValueOf
public static java.lang.String stringValueOf(int i)
- Returns the String of _stringValueOfInt[] using the relevant index.
- Parameters:
i - int
- Returns:
- java.lang.String
toString
public java.lang.String toString()
- Returns a visual representation of the keyedCollection.
- Overrides:
toString in class java.lang.Object
- Returns:
- java.lang.String
toStrings
public Vector toStrings()
- Returns a visual representation of the keyedCollection.
- Overrides:
toStrings in class DataElement
- Returns:
- Vector
tryGetElementAt
public DataElement tryGetElementAt(java.lang.String aName)
- Returns the data element identified by its name. It is found by the path indicated in the aName parameter.
The path is set by identifier strings separated by a period (.).
An asterisk (*) specifies a search in any level of depth in this keyed collection.
- Overrides:
tryGetElementAt in class DataElement
- Parameters:
aName - java.lang.String - The path and name of the data element to be retrieved
- Returns:
- DataElement
tryGetElementAtAnyLevel
public DataElement tryGetElementAtAnyLevel(java.lang.String aName)
- Returns the first element that matches aName at any level of depth of the keyedCollection.
- Parameters:
aName - java.lang.String - The name of the data element to be retrieved
- Returns:
- com.ibm.btt.base.DataElement
tryGetElementAtFirstLevel
protected DataElement tryGetElementAtFirstLevel(java.lang.String aName)
- Returns the element that matches aName. This method only searches in this first level and
not in other levels.
- Parameters:
aName - java.lang.String
- Returns:
- DataElement
tryGetValueAt
public java.lang.Object tryGetValueAt(java.lang.String aCompositeKey)
- Returns the value of an element located in the path aCompositeKey.
Returns null if the element is not found or if it is found but has a null value.
- Parameters:
aCompositeKey - java.lang.String
- Returns:
- java.lang.Object
trySetValueAt
public int trySetValueAt(java.lang.String aName,
java.lang.Object aValue)
throws DSEInvalidArgumentException
- This method call the addElement method to create
the DataElement aName with the value aValue.
- Returns:
- int, 0:success; -1:DSEObjectNotFoundException
- Throws:
com.ibm.btt.base.DSEInvalidArgumentException.
com.ibm.btt.base.DSEObjectNotFoundException.
DSEInvalidArgumentException
writeExternal
public void writeExternal(java.io.ObjectOutput s)
throws java.io.IOException
- Provides concrete serialization handling for KeyedCollection.
- Specified by:
writeExternal in interface java.io.Externalizable - Overrides:
writeExternal in class DataElement
- Parameters:
s - java.io.ObjectOutput
- Throws:
java.io.IOException
writeToStream
public void writeToStream(java.io.ObjectOutput s)
throws java.io.IOException
- Provides concrete serialization handling for KeyedCollection. This method
serializes the current KeyedCollection.
- Parameters:
s - java.io.ObjectOutput
- Throws:
java.io.IOException
isCompressable
public boolean isCompressable()
- Returns:
- compress flag
setCompressable
public void setCompressable(boolean compress)
- set compress flag
- Parameters:
compress -
(c) Copyright IBM Corporation 1998, 2009
|