|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.devexperts.qd.kit.PlainIntField
public class PlainIntField
The PlainIntField
represents an integer field with plain serialized form.
It can be used for fields which are usually represented with large integer or
floating-point values, such as times, coefficients, amounts, etc.
Constructor Summary | |
---|---|
PlainIntField(int index,
java.lang.String name)
|
Method Summary | |
---|---|
boolean |
equals(int value1,
int value2)
Compares two specified field values for equality. |
int |
getIndex()
Returns index of this field in its parent DataRecord . |
java.lang.String |
getLocalName()
Returns local name of this field -- the name of this field that is unique withing the record. |
java.lang.String |
getName()
Returns name of this field. |
DataRecord |
getRecord()
Returns parent DataRecord of this field. |
SerialFieldType |
getSerialType()
Returns serial type of this field. |
int |
parseString(java.lang.String value)
Parses string representation of specified field value. |
int |
readInt(java.io.DataInput in)
Reads field value from specified data intput and returns it to the caller. |
protected int |
readIntFast(com.devexperts.io.BufferedInput in)
|
void |
setRecord(DataRecord record)
Sets reference to parent data record. |
double |
toDouble(int value)
Converts raw QD int-value to meaningful double value, or to Double.NaN if inapplicable. |
int |
toInt(double value)
Converts meaningful double value to raw QD int-value, or to 0 if inapplicable. |
java.lang.String |
toString()
|
java.lang.String |
toString(int value)
Returns string representation of specified field value. |
void |
writeInt(java.io.DataOutput out,
int value)
Writes specified field value into specified data output. |
protected void |
writeIntFast(com.devexperts.io.BufferedOutput out,
int value)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.devexperts.qd.DataField |
---|
getIndex, getLocalName, getName, getRecord |
Constructor Detail |
---|
public PlainIntField(int index, java.lang.String name)
Method Detail |
---|
public final void writeInt(java.io.DataOutput out, int value) throws java.io.IOException
writeInt
in interface DataIntField
java.io.IOException
- as specified data output does.protected final void writeIntFast(com.devexperts.io.BufferedOutput out, int value) throws java.io.IOException
java.io.IOException
public final int readInt(java.io.DataInput in) throws java.io.IOException
readInt
in interface DataIntField
java.io.IOException
- as specified data input does.protected final int readIntFast(com.devexperts.io.BufferedInput in) throws java.io.IOException
java.io.IOException
public final SerialFieldType getSerialType()
DataField
public java.lang.String toString(int value)
Integer.toString(value)
.
toString
in interface DataIntField
public int parseString(java.lang.String value)
Integer.parseInt(value)
.
parseString
in interface DataIntField
java.lang.IllegalArgumentException
- if string cannot be parsed.public double toDouble(int value)
Double.NaN
if inapplicable.
toDouble
in interface DataIntField
public int toInt(double value)
0
if inapplicable.
toInt
in interface DataIntField
public boolean equals(int value1, int value2)
value1 == value2
.
equals
in interface DataIntField
public final void setRecord(DataRecord record)
java.lang.IllegalStateException
- if parent record already set to different instance.public final java.lang.String toString()
toString
in class java.lang.Object
public final DataRecord getRecord()
DataField
DataRecord
of this field.
getRecord
in interface DataField
public final int getIndex()
DataField
DataRecord
.
getIndex
in interface DataField
public final java.lang.String getName()
DataField
DataScheme
.
It is required that this full field name consists of its parent record name
followed by dot ('.') followed by local name
of this filed
like these: "FooRecord.Category", "FooRecord.Amount", etc.
getName
in interface DataField
public java.lang.String getLocalName()
DataField
getLocalName
in interface DataField
DataField.getName()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |