org.openfast.template.type
Class IntegerType

java.lang.Object
  extended by org.openfast.template.type.Type
      extended by org.openfast.template.type.SimpleType
          extended by org.openfast.template.type.IntegerType
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
SignedIntegerType, UnsignedIntegerType

public abstract class IntegerType
extends SimpleType

See Also:
Serialized Form

Field Summary
protected  long maxValue
           
protected  long minValue
           
 
Fields inherited from class org.openfast.template.type.Type
ALL_TYPES, ASCII, BYTE_VECTOR, DECIMAL, I16, I32, I64, I8, INTEGER_TYPES, STRING, U16, U32, U64, U8, UNICODE
 
Constructor Summary
IntegerType(java.lang.String typeName, long minValue, long maxValue, TypeCodec codec, TypeCodec nullableCodec)
           
 
Method Summary
 ScalarValue getDefaultValue()
           
protected  ScalarValue getVal(java.lang.String value)
           
 boolean isValueOf(ScalarValue previousValue)
           
 void validateValue(ScalarValue value)
          Validates the passed ScalarValue, if fails, throws error.
 
Methods inherited from class org.openfast.template.type.SimpleType
getCodec, getValue
 
Methods inherited from class org.openfast.template.type.Type
equals, getName, getRegisteredTypeMap, getType, hashCode, serialize, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

minValue

protected final long minValue

maxValue

protected final long maxValue
Constructor Detail

IntegerType

public IntegerType(java.lang.String typeName,
                   long minValue,
                   long maxValue,
                   TypeCodec codec,
                   TypeCodec nullableCodec)
Method Detail

getVal

protected ScalarValue getVal(java.lang.String value)
Specified by:
getVal in class SimpleType
Parameters:
value -
Returns:
either longvalue or integervalue depending on size of parsed number

getDefaultValue

public ScalarValue getDefaultValue()
Specified by:
getDefaultValue in class Type
Returns:
Returns a default value

isValueOf

public boolean isValueOf(ScalarValue previousValue)
Specified by:
isValueOf in class Type
Parameters:
previousValue - The previous value of the Field, used in determining the corresponding field value for the current message being decoded.
Returns:
Returns true if the passed value is an instance of an integer or long

validateValue

public void validateValue(ScalarValue value)
Validates the passed ScalarValue, if fails, throws error.

Overrides:
validateValue in class Type
Parameters:
value - The ScalarValue object to be validated


Copyright © 2006-2008 The LaSalle Technology Group, LLC. All Rights Reserved.