|
IBM WebSphere Multichannel Bank 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.FormatElement
com.ibm.btt.base.FieldFormat
com.ibm.btt.base.FloatFormat
@ATTR(value={"size#String#IMPLIED","byteOrdering#String#IMPLIED"}) public class FloatFormat
This class formats a Float or a Double into the String used as its internal byte-representation. The size of its representation is float (4 bytes) or double precision (8 bytes). You can set attributes to have it return the data field in big-endian (host) or little-endian (PC) byte ordering.
Field Summary |
---|
Fields inherited from class com.ibm.btt.base.FormatElement |
---|
dataElementName, externalizer, name |
Constructor Summary | |
---|---|
FloatFormat()
This is the default constructor used to create a FloatFormat object. |
|
FloatFormat(java.lang.String aName)
This is the constructor used by the Externalizer to create a FloatFormat object. |
Method Summary | |
---|---|
java.lang.String[] |
extract(java.lang.String aString)
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. |
java.lang.String |
format(double value)
Formats a Double into the String used as its internal byte-representation. |
java.lang.String |
format(float value)
Formats a Float into the String used as its internal byte-representation. |
java.lang.String |
formatField(DataField aDataField)
Takes the value of the data field and formats it according its class, Double or Float. |
int |
getByteOrdering()
Returns the value of byteOrdering. |
int |
getSize()
Returns the value of size. |
java.lang.Object |
initializeFrom(Tag aTag)
Initializes a FloatFormat object using the supplied Tag. |
double |
parseToDouble(java.lang.String aString)
Obtains a double from the String used as the double's internal byte-representation. |
float |
parseToFloat(java.lang.String aString)
Obtains a float from the String used as the float's internal byte-representation. |
void |
setByteOrdering(int anInt)
Sets the value of byteOrdering. |
void |
setSize(int aSize)
Sets the value of size. |
java.lang.String |
toString()
Returns a visual representation of the format element. |
int |
unformat(int ndxFrom,
int ndxTo,
java.lang.String str,
DataElement aDataElement)
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). |
DataField |
unformatField(java.lang.String aString,
DataField aDataField)
Changes the String to a Double or Float depending on its size. |
Methods inherited from class com.ibm.btt.base.FieldFormat |
---|
format, format, toStrings, unformat, unformat |
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 |
Constructor Detail |
---|
public FloatFormat()
public FloatFormat(java.lang.String aName) throws java.io.IOException
aName
- java.lang.String
java.io.IOException
Method Detail |
---|
public java.lang.String[] extract(java.lang.String aString) throws DSEInvalidArgumentException
extract
in class FormatElement
aString
- String
DSEInvalidArgumentException
public java.lang.String format(double value) throws DSEInvalidArgumentException
value
- double
DSEInvalidArgumentException
public java.lang.String format(float value) throws DSEInvalidArgumentException
value
- float
DSEInvalidArgumentException
public java.lang.String formatField(DataField aDataField) throws DSEInvalidArgumentException, DSEInvalidClassException
formatField
in class FieldFormat
aDataField
- DataField
DSEInvalidArgumentException
DSEInvalidClassException
public int getByteOrdering()
public int getSize()
public java.lang.Object initializeFrom(Tag aTag) throws java.io.IOException
initializeFrom
in class FormatElement
aTag
- com.ibm.btt.base.Tag
java.io.IOException
public double parseToDouble(java.lang.String aString)
aString
- java.lang.String
public float parseToFloat(java.lang.String aString)
aString
- java.lang.String
public void setByteOrdering(int anInt)
public void setSize(int aSize)
setSize
in class FormatElement
aSize
- intpublic java.lang.String toString()
toString
in class FormatElement
public DataField unformatField(java.lang.String aString, DataField aDataField)
unformatField
in class FieldFormat
aString
- java.lang.String
public int unformat(int ndxFrom, int ndxTo, java.lang.String str, DataElement aDataElement) throws DSEInvalidRequestException, DSEInvalidArgumentException
unformat
in class FieldFormat
ndxFrom
- is the initial indexndxTo
- one is the final index
DSEInvalidRequestException
DSEInvalidArgumentException
|
IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |