java.lang.String[] |
extract(java.lang.String aString)
Methods inherited from class com.ibm.btt.base.FormatElement |
checkIndexes, exceptionInfo, externalizer, getDataElementName, getExternalizer, getName, getTagName, isCacheable, isConstant, isItConstant, isNull, readExternal, readExternal, readObject, reinitialize, removeExternal, rootDecorated, setDataElementName, setExternalizer, setName, toTags, unformat, writeExternal, writeExternal |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
FloatFormat
public FloatFormat()
- This is the default constructor used to create a FloatFormat object.
FloatFormat
public FloatFormat(java.lang.String aName)
throws java.io.IOException
- This is the constructor used by the Externalizer to create a FloatFormat object.
- Parameters:
aName - java.lang.String
- Throws:
java.io.IOException
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.
- Overrides:
extract in class FormatElement
- Parameters:
aString - String
- Returns:
- String[]
- Throws:
DSEInvalidArgumentException
format
public java.lang.String format(double value)
throws DSEInvalidArgumentException
- Formats a Double into the String used as its internal byte-representation.
- Parameters:
value - double
- Returns:
- java.lang.String
- Throws:
DSEInvalidArgumentException
format
public java.lang.String format(float value)
throws DSEInvalidArgumentException
- Formats a Float into the String used as its internal byte-representation.
- Parameters:
value - float
- Returns:
- java.lang.String
- Throws:
DSEInvalidArgumentException
formatField
public java.lang.String formatField(DataField aDataField)
throws DSEInvalidArgumentException,
DSEInvalidClassException
- Takes the value of the data field and formats it according
its class, Double or Float.
- Specified by:
formatField in class FieldFormat
- Parameters:
aDataField - DataField
- Returns:
- java.lang.String
- Throws:
DSEInvalidArgumentException
DSEInvalidClassException
getByteOrdering
public int getByteOrdering()
- Returns the value of byteOrdering.
- Returns:
- int
getSize
public int getSize()
- Returns the value of size.
- Returns:
- int
initializeFrom
public java.lang.Object initializeFrom(Tag aTag)
throws java.io.IOException
- Initializes a FloatFormat object using the supplied Tag.
- Specified by:
initializeFrom in class FormatElement
- Parameters:
aTag - com.ibm.btt.base.Tag
- Returns:
- java.lang.Object
- Throws:
java.io.IOException
parseToDouble
public double parseToDouble(java.lang.String aString)
- Obtains a double from the String used as the double's internal byte-representation.
- Parameters:
aString - java.lang.String
- Returns:
- double
parseToFloat
public float parseToFloat(java.lang.String aString)
- Obtains a float from the String used as the float's internal byte-representation.
- Parameters:
aString - java.lang.String
- Returns:
- float
setByteOrdering
public void setByteOrdering(int anInt)
- Sets the value of byteOrdering. The values for this attribute are:
0 ==> PC or littleEndian
1 ==> Host or bigEndian.
setSize
public void setSize(int aSize)
- Sets the value of size. The values for this attribute are:
4 ==> float representation
8 ==> double representation.
- Overrides:
setSize in class FormatElement
- Parameters:
aSize - int
toString
public java.lang.String toString()
- Returns a visual representation of the format element.
- Overrides:
toString in class FormatElement
- Returns:
- java.lang.String
unformatField
public DataField unformatField(java.lang.String aString,
DataField aDataField)
- Changes the String to a Double or Float depending on its size.
- Specified by:
unformatField in class FieldFormat
- Parameters:
aString - java.lang.String
- Returns:
- DataField
unformat
public int unformat(int ndxFrom,
int ndxTo,
java.lang.String str,
DataElement aDataElement)
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).
- Overrides:
unformat in class FieldFormat
- Parameters:
ndxFrom - is the initial indexndxTo - one is the final index
- Throws:
DSEInvalidRequestException
DSEInvalidArgumentException
(c) Copyright IBM Corporation 1998, 2009
|