IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.base
Class KeyedCollectionFormat

java.lang.Object
  extended by com.ibm.btt.base.FormatElement
      extended by com.ibm.btt.base.KeyedCollectionFormat
All Implemented Interfaces:
Cacheable, java.io.Externalizable, java.io.Serializable
Direct Known Subclasses:
DynamicXMLFormat, RecordFormat

public abstract class KeyedCollectionFormat
extends FormatElement

This abstract class contains a collection of format elements used to format the elements of a KeyedCollection. This class provides a protocol to add, remove, and change these elements.

See Also:
Serialized Form

Field Summary
(package private)  boolean dataElementEmpty
           
(package private)  Vector elements
           
 
Fields inherited from class com.ibm.btt.base.FormatElement
dataElementName, externalizer, name
 
Constructor Summary
KeyedCollectionFormat()
           
 
Method Summary
 KeyedCollectionFormat add(FormatElement aFormatElement)
          Adds an element to the last position of the KeyedCollection.
 KeyedCollectionFormat addElementAt(FormatElement aFormatElement, int pos)
          Adds an element to the position determined by the pos parameter.
 KeyedCollectionFormat addFirst(FormatElement aFormatElement)
          Adds an element to the first position of the KeyedCollection.
 FormatElement at(int anIndex)
          Returns the element at the position marked by anIndex.
protected  void checkIndexes(int ndxFrom, int ndxTo, java.lang.String str)
          Check whether the ndxFrom and the ndxTo are valid
 java.lang.String format(Context aContext)
          Formats data elements, getting them from the context.
 java.lang.String format(DataElement aDataElement)
          Formats KeyedCollection passed as parameter.
abstract  java.lang.String formatContext(Context aContext)
          Abstract method.
abstract  java.lang.String formatKeyedCollection(KeyedCollection aKeyedCollection)
          Abstract method.
 boolean getDataElementEmpty()
          Returns if dataElement is empty.
 Vector getElements()
          Gets the elements property (Vector) value.
 java.util.Enumeration getEnumeration()
          Returns the elements of this format as an Enumeration.
 void reinitialize()
          This method will call elements reinitialize .
 void removeAll()
          Remove the elements of this format.
 FormatElement removeAt(int anIndex)
          Remove the element of this format marked by anIndex.
 void setElements(Vector v)
          Sets the elements property (Vector) value.
 int size()
          Returns the number of elements of this format.
 int unformat(int ndxFrom, int ndxTo, java.lang.String str, Context ctx)
          new method added to KeyedCollection, will forward to original unformat implemenation unformat(String,Context).
 int unformat(int ndxFrom, int ndxTo, java.lang.String str, DataElement de)
          The new unformat methods added to the FormatElement to minimize the instances created during the unfomat process that later will be collected by the garbage collector (GC).
 DataElement unformat(java.lang.String aString, Context aContext)
          Returns a data element by unformatting the KeyedCollection using the context passed as a parameter.
 DataElement unformat(java.lang.String aString, DataElement aDataElement)
          Returns a data element by unformatting the KeyedCollection using the data element passed as a parameter.
abstract  DataElement unformatContext(java.lang.String aString, Context aContext)
          Abstract method.
abstract  KeyedCollection unformatKeyedCollection(java.lang.String aString, KeyedCollection aKeyedCollection)
          Abstract method.
 
Methods inherited from class com.ibm.btt.base.FormatElement
exceptionInfo, externalizer, extract, getDataElementName, getExternalizer, getName, getTagName, initializeFrom, isCacheable, isConstant, isItConstant, isNull, readExternal, readExternal, readObject, removeExternal, rootDecorated, setDataElementName, setExternalizer, setName, setSize, toString, toStrings, toTags, writeExternal, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

elements

Vector elements

dataElementEmpty

boolean dataElementEmpty
Constructor Detail

KeyedCollectionFormat

public KeyedCollectionFormat()
Method Detail

add

public KeyedCollectionFormat add(FormatElement aFormatElement)
Adds an element to the last position of the KeyedCollection.

Parameters:
aFormatElement - com.ibm.btt.base.FormatElement
Returns:
KeyedCollectionFormat

addElementAt

public KeyedCollectionFormat addElementAt(FormatElement aFormatElement,
                                          int pos)
Adds an element to the position determined by the pos parameter.

Parameters:
aFormatElement - com.ibm.btt.base.FormatElement
pos - int
Returns:
KeyedCollectionFormat

addFirst

public KeyedCollectionFormat addFirst(FormatElement aFormatElement)
Adds an element to the first position of the KeyedCollection.

Parameters:
aFormatElement - com.ibm.btt.base.FormatElement
Returns:
KeyedCollectionFormat

at

public FormatElement at(int anIndex)
Returns the element at the position marked by anIndex.

Parameters:
anIndex - int
Returns:
com.ibm.btt.base.FormatElement

format

public java.lang.String format(Context aContext)
                        throws DSEInvalidClassException,
                               DSEInvalidRequestException,
                               DSEInvalidArgumentException
Formats data elements, getting them from the context.

Overrides:
format in class FormatElement
Parameters:
aContext - com.ibm.btt.base.Context
Returns:
java.lang.String
Throws:
DSEInvalidClassException
DSEInvalidRequestException
DSEInvalidArgumentException

format

public java.lang.String format(DataElement aDataElement)
                        throws DSEInvalidClassException,
                               DSEInvalidRequestException,
                               DSEInvalidArgumentException
Formats KeyedCollection passed as parameter. If it is not a KeyedCollection then throws an Exception.

Specified by:
format in class FormatElement
Parameters:
aDataElement - com.ibm.btt.base.DataElement
Returns:
java.lang.String
Throws:
DSEInvalidClassException
DSEInvalidRequestException
DSEInvalidArgumentException

formatContext

public abstract java.lang.String formatContext(Context aContext)
                                        throws DSEInvalidClassException,
                                               DSEInvalidRequestException,
                                               DSEInvalidArgumentException
Abstract method. It must be implemented by subclasses.

Parameters:
aContext - com.ibm.btt.base.Context
Returns:
java.lang.String
Throws:
DSEInvalidClassException
DSEInvalidRequestException
DSEInvalidArgumentException

formatKeyedCollection

public abstract java.lang.String formatKeyedCollection(KeyedCollection aKeyedCollection)
                                                throws DSEInvalidClassException,
                                                       DSEInvalidRequestException,
                                                       DSEInvalidArgumentException
Abstract method. It must be implemented by subclasses.

Parameters:
aKeyedCollection - com.ibm.btt.base.KeyedCollection
Returns:
java.lang.String
Throws:
DSEInvalidClassException
DSEInvalidRequestException
DSEInvalidArgumentException

getDataElementEmpty

public boolean getDataElementEmpty()
Returns if dataElement is empty.

Returns:
boolean

getElements

public Vector getElements()
Gets the elements property (Vector) value.

Returns:
java.util.Vector - The elements property value
See Also:
setElements(com.ibm.btt.base.Vector)

getEnumeration

public java.util.Enumeration getEnumeration()
Returns the elements of this format as an Enumeration.

Returns:
java.util.Enumeration

reinitialize

public void reinitialize()
This method will call elements reinitialize .

Specified by:
reinitialize in interface Cacheable
Overrides:
reinitialize in class FormatElement

removeAll

public void removeAll()
Remove the elements of this format.


removeAt

public FormatElement removeAt(int anIndex)
Remove the element of this format marked by anIndex.

Parameters:
anIndex - int
Returns:
com.ibm.btt.base.FormatElement

setElements

public void setElements(Vector v)
Sets the elements property (Vector) value.

Parameters:
v - java.util.Vector - The new value for the property
See Also:
getElements()

size

public int size()
Returns the number of elements of this format.

Returns:
int

unformat

public DataElement unformat(java.lang.String aString,
                            Context aContext)
                     throws DSEInvalidRequestException,
                            DSEInvalidArgumentException
Returns a data element by unformatting the KeyedCollection using the context passed as a parameter.

Overrides:
unformat in class FormatElement
Parameters:
aString - java.lang.String
aContext - com.ibm.btt.base.Context
Returns:
com.ibm.btt.base.DataElement
Throws:
DSEInvalidRequestException
DSEInvalidArgumentException

unformat

public DataElement unformat(java.lang.String aString,
                            DataElement aDataElement)
                     throws DSEInvalidRequestException,
                            DSEInvalidArgumentException
Returns a data element by unformatting the KeyedCollection using the data element passed as a parameter. If the data element is not a KeyedCollection, the method throws an Exception.

Specified by:
unformat in class FormatElement
Parameters:
aString - java.lang.String
aDataElement - com.ibm.btt.base.DataElement
Returns:
com.ibm.btt.base.DataElement
Throws:
DSEInvalidRequestException
DSEInvalidArgumentException

unformatContext

public abstract DataElement unformatContext(java.lang.String aString,
                                            Context aContext)
                                     throws DSEInvalidRequestException,
                                            DSEInvalidArgumentException
Abstract method. It must be implemented by subclasses.

Parameters:
aString - java.lang.String
aContext - com.ibm.btt.base.Context
Returns:
com.ibm.btt.base.DataElement
Throws:
DSEInvalidRequestException
DSEInvalidArgumentException

unformatKeyedCollection

public abstract KeyedCollection unformatKeyedCollection(java.lang.String aString,
                                                        KeyedCollection aKeyedCollection)
                                                 throws DSEInvalidRequestException,
                                                        DSEInvalidArgumentException
Abstract method. It must be implemented by subclasses.

Parameters:
aString - java.lang.String
aKeyedCollection - com.ibm.btt.base.KeyedCollection
Returns:
com.ibm.btt.base.KeyedCollection
Throws:
DSEInvalidRequestException
DSEInvalidArgumentException

unformat

public int unformat(int ndxFrom,
                    int ndxTo,
                    java.lang.String str,
                    DataElement de)
             throws DSEInvalidRequestException,
                    DSEInvalidArgumentException
Description copied from class: FormatElement
The new unformat methods added to the FormatElement to minimize the instances created during the unfomat process that later will be collected by the garbage collector (GC).

Overrides:
unformat in class FormatElement
Parameters:
ndxFrom - is the initial index
ndxTo - one is the final index
Throws:
DSEInvalidRequestException
DSEInvalidArgumentException

unformat

public int unformat(int ndxFrom,
                    int ndxTo,
                    java.lang.String str,
                    Context ctx)
             throws DSEInvalidRequestException,
                    DSEInvalidArgumentException
new method added to KeyedCollection, will forward to original unformat implemenation unformat(String,Context).

Overrides:
unformat in class FormatElement
Parameters:
ndxForm - int
ndxTo - int
str - String
ctx - Context
Returns:
int
Throws:
DSEInvalidRequestException
DSEInvalidArgumentException

checkIndexes

protected void checkIndexes(int ndxFrom,
                            int ndxTo,
                            java.lang.String str)
                     throws DSEInvalidArgumentException
Check whether the ndxFrom and the ndxTo are valid

Overrides:
checkIndexes in class FormatElement
Parameters:
ndxFrom - - the initial index
ndxTo - - the final index
Throws:
DSEInvalidArgumentException

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2009