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 |
IntegerFormat
public IntegerFormat()
- This is the default constructor used to create an IntegerFormat object.
IntegerFormat
public IntegerFormat(java.lang.String aName)
throws java.io.IOException
- This constructor creates an IntegerFormat object with the specified name.
- Parameters:
aName - java.lang.String
- Throws:
java.io.IOException
extract
public java.lang.String[] extract(java.lang.String aString)
throws DSEInvalidArgumentException
- Extracts the String according its size attribute.
- Overrides:
extract in class FormatElement
- Parameters:
aString - String
- Returns:
- String[]
- Throws:
DSEInvalidArgumentException
format
public java.lang.String format(long aValue)
throws DSEInvalidArgumentException
- Returns the integer's binary representation in a chain of bytes provided. aValue
is from one to eight bytes in size.
- Parameters:
aValue - long
- Returns:
- java.lang.String
- Throws:
DSEInvalidArgumentException
formatField
public java.lang.String formatField(DataField aDataField)
throws DSEInvalidArgumentException,
DSEInvalidClassException
- Accesses the value of the DataField and checks that it is a valid integer.
It then returns the integer's binary representation in a chain of bytes provided. aValue
is from one to eight bytes in size.
- Specified by:
formatField in class FieldFormat
- Parameters:
aDataField - DataField
- Returns:
- String
- Throws:
DSEInvalidArgumentException
DSEInvalidClassException
getByteOrdering
public int getByteOrdering()
- Returns the value of byteOrdering.
- Returns:
- int
getSign
public boolean getSign()
- Returns the value of sign.
- Returns:
- boolean
getSize
public int getSize()
- Returns the value of size.
- Returns:
- int
initializeFrom
public java.lang.Object initializeFrom(Tag aTag)
throws java.io.IOException
- Initializes an IntegerFormat with the aTag attributes.
- Specified by:
initializeFrom in class FormatElement
- Parameters:
aTag - com.ibm.btt.base.Tag
- Returns:
- java.lang.Object
- Throws:
java.io.IOException
parse
public long parse(java.lang.String aString)
throws DSEInvalidArgumentException
- Converts aString to a char[] and then converts the char[] to a Java long.
- Parameters:
aString - java.lang.String
- Returns:
- long
- Throws:
DSEInvalidArgumentException
setByteOrdering
public void setByteOrdering(int anInt)
- Sets the value of byteOrdering. The values of the parameter are:
0 ==> PC or littleEndian
1 ==> Host or bigEndian.
setSign
public void setSign(boolean useSign)
- Sets the sign.
- Parameters:
useSign - boolean
setSize
public void setSize(int aSize)
- Sets the value of size. The values of the parameter are:
1 byte representation
2 short representation
3
4 integer representation
5
6
7
8 long representation.
- Overrides:
setSize in class FormatElement
- Parameters:
aSize - int
toString
public java.lang.String toString()
- Converts the IntegerFormat to a String. Default values are not concatenated.
- Overrides:
toString in class FormatElement
- Returns:
- java.lang.String
unformatField
public DataField unformatField(java.lang.String aString,
DataField aDataField)
throws DSEInvalidArgumentException
- Updates the DataField value by interpreting the input string.
If the size of the number is:
of 1 byte then the DataField value will be updated with a Byte Object.
of 2 bytes then the DataField value will be updated with a Short Object.
of from 3 to 4 bytes then the DataField value will be updated with an Integer Object.
of from 5 to 8 bytes then the DataField value will be updated with a Long Object.
- Specified by:
unformatField in class FieldFormat
- Parameters:
aString - StringaDataField - DataField
- Returns:
- DataField
- Throws:
DSEInvalidArgumentException
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
|