com.devexperts.qd.kit
Class ShortStringField
java.lang.Object
com.devexperts.qd.kit.AbstractDataField
com.devexperts.qd.kit.AbstractDataIntField
com.devexperts.qd.kit.CompactIntField
com.devexperts.qd.kit.ShortStringField
- All Implemented Interfaces:
- DataField, DataIntField
public class ShortStringField
- extends CompactIntField
The ShortStringField
represents a short (up to 4 characters) string
in a single integer with compact serialized form.
It can be used to represent short fixed-size character codes, such as MMID, etc.
Method Summary |
int |
parseString(java.lang.String value)
Parses string representation of specified field value. |
double |
toDouble(int value)
Converts raw QD int-value to meaningful double value, or to Double.NaN if inapplicable. |
java.lang.String |
toString(int value)
Returns string representation of specified field value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ShortStringField
public ShortStringField(int index,
java.lang.String name)
ShortStringField
public ShortStringField(int index,
java.lang.String name,
SerialFieldType serialType)
toString
public java.lang.String toString(int value)
- Description copied from class:
AbstractDataIntField
- Returns string representation of specified field value.
This method is used for debugging purposes.
This implementation returns
Integer.toString(value)
.
- Specified by:
toString
in interface DataIntField
- Overrides:
toString
in class AbstractDataIntField
parseString
public int parseString(java.lang.String value)
- Description copied from class:
AbstractDataIntField
- Parses string representation of specified field value.
This method is used for debugging purposes.
This implementation returns
Integer.parseInt(value)
.
- Specified by:
parseString
in interface DataIntField
- Overrides:
parseString
in class AbstractDataIntField
toDouble
public double toDouble(int value)
- Description copied from class:
AbstractDataIntField
- Converts raw QD int-value to meaningful double value, or to
Double.NaN
if inapplicable.
- Specified by:
toDouble
in interface DataIntField
- Overrides:
toDouble
in class AbstractDataIntField