com.devexperts.qd.kit
Class AbstractDataIntField

java.lang.Object
  extended by com.devexperts.qd.kit.AbstractDataField
      extended by com.devexperts.qd.kit.AbstractDataIntField
All Implemented Interfaces:
DataField, DataIntField
Direct Known Subclasses:
CompactCharField, CompactIntField, PlainIntField, VoidIntField

public abstract class AbstractDataIntField
extends AbstractDataField
implements DataIntField


Method Summary
 boolean equals(int value1, int value2)
          Compares two specified field values for equality.
 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.
 int toInt(double value)
          Converts meaningful double value to raw QD int-value, or to 0 if inapplicable.
 java.lang.String toString(int value)
          Returns string representation of specified field value.
 
Methods inherited from class com.devexperts.qd.kit.AbstractDataField
getIndex, getLocalName, getName, getRecord, getSerialType, setRecord, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.devexperts.qd.DataIntField
readInt, readInt, writeInt, writeInt
 
Methods inherited from interface com.devexperts.qd.DataField
getIndex, getLocalName, getName, getRecord, getSerialType
 

Method Detail

toString

public java.lang.String toString(int value)
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

parseString

public int parseString(java.lang.String value)
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
Throws:
java.lang.IllegalArgumentException - if string cannot be parsed.

toDouble

public double toDouble(int value)
Converts raw QD int-value to meaningful double value, or to Double.NaN if inapplicable.

Specified by:
toDouble in interface DataIntField

toInt

public int toInt(double value)
Converts meaningful double value to raw QD int-value, or to 0 if inapplicable.

Specified by:
toInt in interface DataIntField

equals

public boolean equals(int value1,
                      int value2)
Compares two specified field values for equality. This method is used for implementation of ticker contract. This implementation returns value1 == value2.

Specified by:
equals in interface DataIntField