checkIndexes(int ndxFrom,
int ndxTo,
java.lang.String str)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
dataElementName
public java.lang.String dataElementName
- The name of the formatted data element.
name
public java.lang.String name
- The identifier of the FormatElement instance.
externalizer
static Externalizer externalizer
FormatElement
public FormatElement()
exceptionInfo
public java.lang.String exceptionInfo()
- Gets the class name.
- Returns:
- String
externalizer
public Externalizer externalizer()
- Returns the instance of the externalizer for this class.
- Returns:
- com.ibm.btt.base.Externalizer
extract
public java.lang.String[] extract(java.lang.String aString)
throws DSEInvalidArgumentException
- Extracts (strips) the substring corresponding to the format element from
the input String and returns it and the remaining String as the elements
of an array. This method is called by the unformat() method of the
collections formats such as RecordFormat and
IndexedCollectionFormat. The default behavior is to accept the
whole input String.
- Parameters:
aString - String
- Returns:
- String[]
- Throws:
DSEInvalidArgumentException
format
public java.lang.String format(Context aContext)
throws DSEInvalidClassException,
DSEInvalidRequestException,
DSEInvalidArgumentException
- Throws an Exception. Only KeyedCollectionFormats can format a
Context. This method is implemented for polymorphism.
- Parameters:
aContext - com.ibm.btt.base.Context
- Returns:
- java.lang.String
- Throws:
DSEInvalidClassException
DSEInvalidRequestException
DSEInvalidArgumentException
format
public abstract java.lang.String format(DataElement aDataElement)
throws DSEInvalidClassException,
DSEInvalidRequestException,
DSEInvalidArgumentException
- Format abstract class.
- Parameters:
aDataElement - DataElement
- Returns:
- String
- Throws:
DSEInvalidClassException
DSEInvalidRequestException
DSEInvalidArgumentException
getDataElementName
public java.lang.String getDataElementName()
- Returns the value of dataElementName.
- Returns:
- java.lang.String
getExternalizer
public static Externalizer getExternalizer()
- Gets the Externalizer.
- Returns:
- com.ibm.btt.base.Externalizer
getName
public java.lang.String getName()
- Returns the value of name.
- Specified by:
getName in interface Cacheable
- Returns:
- java.lang.String
getTagName
public java.lang.String getTagName()
- Gets a tag name.
- Returns:
- java.lang.String
initializeFrom
public abstract java.lang.Object initializeFrom(Tag aTag)
throws java.io.IOException,
DSEException
- Initializes a FormatElement with the Tag attributes.
- Parameters:
aTag - com.ibm.btt.base.Tag
- Throws:
java.io.IOException
DSEException
isCacheable
public boolean isCacheable()
- This method finds out if THIS particular object can be cached.
- Specified by:
isCacheable in interface Cacheable
- Returns:
- boolean
isConstant
public java.lang.Boolean isConstant()
- Returns false. It is not a constant. It is recommended to use boolean
isItConstant() instead of this method.
- Returns:
- Boolean
isItConstant
public boolean isItConstant()
- Returns false. It is not a constant.
- Returns:
- Boolean
readExternal
public void readExternal()
throws java.io.IOException
- Initializes a data element with its external value. To work properly, the
data element must have an ID (name) and the Externalizer and its
tagInputStream are initialized.
- Throws:
java.io.IOException
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
- Parameters:
s - java.io.ObjectInput
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
readObject
public static java.lang.Object readObject(java.lang.String name)
throws java.io.IOException
- Instantiates a Format called "name" from the definitions file.
- Parameters:
name - java.lang.String
- Returns:
- java.lang.Object
- Throws:
java.io.IOException
reinitialize
public void reinitialize()
- This method will reinitialize THIS object. It should be called
immediately after being extracted from the cache.
- Specified by:
reinitialize in interface Cacheable
removeExternal
public void removeExternal()
throws java.io.IOException
- Removes the tags for this object from the definitions file.
- Throws:
java.io.IOException
rootDecorated
public FormatElement rootDecorated()
- Returns this element. It is implemented to provide polymorphism.
setDataElementName
public void setDataElementName(java.lang.String aDataElementName)
- Sets the value of dataElementName.
- Parameters:
aDataElementName - java.lang.String
setExternalizer
public static void setExternalizer(Externalizer anExternalizer)
- Sets the Externalizer.
- Parameters:
anExternalizer - com.ibm.btt.base.Externalizer
setName
public void setName(java.lang.String aName)
- Returns the value of name.
- Parameters:
aName - java.lang.String
setSize
public void setSize(int anInt)
- Does nothing. Necessary to implement removeDecoration() on
SelfLength
- Parameters:
anInt - int
toString
public java.lang.String toString()
- Returns a visual representation of this format element.
- Overrides:
toString in class java.lang.Object
- Returns:
- java.lang.String
toStrings
public Vector toStrings()
- Returns a visual representation of this format element.
- Returns:
- com.ibm.btt.base.Vector
toTags
public Vector toTags()
throws java.io.IOException
- Returns a Vector with the FormatElement represented as a Tag.
- Returns:
- com.ibm.btt.base.Vector
- Throws:
java.io.IOException
unformat
public DataElement unformat(java.lang.String aString,
Context aContext)
throws DSEInvalidRequestException,
DSEInvalidArgumentException
- Throws an Exception. Only KeyedCollectionFormats can unformat a
Context. This method is implemented for polymorphism.
- Parameters:
aContext - com.ibm.btt.base.Context
- Returns:
- com.ibm.btt.base.DataElement
- Throws:
DSEInvalidRequestException
DSEInvalidArgumentException
unformat
public abstract DataElement unformat(java.lang.String aString,
DataElement aDataElement)
throws DSEInvalidRequestException,
DSEInvalidArgumentException
- Unformat abstract method. To be implemented by the subclasses.
- Throws:
DSEInvalidRequestException
DSEInvalidArgumentException
writeExternal
public void writeExternal()
throws java.io.IOException
- Writes this instance converted in tags in a file. It should be called
when the Externalizer has not initialized its tagStream. Once the
tagStream is initialized, the method to call is writeExternal().
- Throws:
java.io.IOException
writeExternal
public void writeExternal(java.io.ObjectOutput s)
throws java.io.IOException
- Provides concrete serialization handling for FormatElement.
- Specified by:
writeExternal in interface java.io.Externalizable
- Parameters:
s - java.io.ObjectOutput
- Throws:
java.io.IOException
unformat
public int unformat(int ndxFrom,
int ndxTo,
java.lang.String str,
DataElement de)
throws DSEInvalidRequestException,
DSEInvalidArgumentException
- 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).
- Parameters:
ndxFrom - is the initial indexndxTo - 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
- 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).
- Parameters:
ndxFrom - is the initial indexndxTo - one is the final index
- Throws:
DSEInvalidRequestException
DSEInvalidArgumentException
isNull
protected boolean isNull(int ndxFrom,
int ndxTo)
- Check whether the ndxFrom is equals to the ndxTo
- Parameters:
ndxFrom - is the initial indexndxTo - one is the final index
checkIndexes
protected void checkIndexes(int ndxFrom,
int ndxTo,
java.lang.String str)
throws DSEInvalidArgumentException
- Check whether the ndxFrom and the ndxTo are valid
- Parameters:
ndxFrom - is the initial indexndxTo - one is the final index
- Throws:
DSEInvalidArgumentException
(c) Copyright IBM Corporation 1998, 2009
|