|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.dse.base.FormatElement | +--com.ibm.dse.base.FieldFormat | +--com.ibm.dse.base.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.
Fields inherited from class com.ibm.dse.base.FormatElement |
dataElementName,
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.The values for this attribute are: 0 ==> PC or littleEndian 1 ==> Host or bigEndian. |
void |
setSize(int aSize)
Sets the value of size. |
java.lang.String |
toString()
Returns a visual representation of the format element. |
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.dse.base.FieldFormat |
format,
format,
unformat,
unformat |
Methods inherited from class com.ibm.dse.base.FormatElement |
exceptionInfo,
externalizer,
format,
getDataElementName,
getExternalizer,
getName,
getTagName,
isCacheable,
isConstant,
readExternal,
readExternal,
readObject,
reinitialize,
removeExternal,
rootDecorated,
setDataElementName,
setExternalizer,
setName,
toStrings,
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.StringMethod Detail |
public java.lang.String[] extract(java.lang.String aString) throws DSEInvalidArgumentException
aString
- Stringpublic java.lang.String format(double value) throws DSEInvalidArgumentException
value
- doublepublic java.lang.String format(float value) throws DSEInvalidArgumentException
value
- floatpublic java.lang.String formatField(DataField aDataField) throws DSEInvalidArgumentException, DSEInvalidClassException
aDataField
- DataFieldpublic int getByteOrdering()
public int getSize()
public java.lang.Object initializeFrom(Tag aTag) throws java.io.IOException
aTag
- com.ibm.dse.base.Tagpublic double parseToDouble(java.lang.String aString)
aString
- java.lang.Stringpublic float parseToFloat(java.lang.String aString)
aString
- java.lang.Stringpublic void setByteOrdering(int anInt)
public void setSize(int aSize)
anInt
- intpublic java.lang.String toString()
public DataField unformatField(java.lang.String aString, DataField aDataField)
aString
- java.lang.String
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |