org.ujac.util.exi.type
Class FloatType

java.lang.Object
  extended by org.ujac.util.exi.type.BaseType
      extended by org.ujac.util.exi.type.BaseNumberType
          extended by org.ujac.util.exi.type.FloatType
All Implemented Interfaces:
ExpressionType

public class FloatType
extends BaseNumberType

Name: FloatType
Description: An expression type handler for float values.

Author:
lauerc

Nested Class Summary
 class FloatType.AbsOperation
          The 'abs' operation for Floats.
 class FloatType.AddOperation
          The 'add' operation for Floats.
 class FloatType.DivOperation
          The 'div' operation for Floats.
 class FloatType.EqualOperation
          The equal compare operation for Floats.
 class FloatType.GreaterEqualOperation
          The 'greater equal' compare operation for Floats.
 class FloatType.GreaterOperation
          The 'greater' compare operation for Floats.
 class FloatType.LessEqualOperation
          The 'less equal' compare operation for Floats.
 class FloatType.LessOperation
          The 'less' compare operation for Floats.
 class FloatType.MaxOperation
          The 'max' operation for Floats.
 class FloatType.MinOperation
          The 'min' operation for Floats.
 class FloatType.MulOperation
          The 'mul' operation for Floats.
 class FloatType.NotEqualOperation
          The 'not equal' compare operation for Floats.
 class FloatType.SubOperation
          The 'sub' operation for Floats.
 
Nested classes/interfaces inherited from class org.ujac.util.exi.type.BaseNumberType
BaseNumberType.FormatOperation
 
Nested classes/interfaces inherited from class org.ujac.util.exi.type.BaseType
BaseType.InstanceofOperation, BaseType.ObjectDefinedOperation, BaseType.ObjectNotDefinedOperation, BaseType.ToStringOperation
 
Field Summary
 
Fields inherited from class org.ujac.util.exi.type.BaseType
interpreter, operations
 
Constructor Summary
FloatType(ExpressionInterpreter interpreter)
          Constructs a FloatType instance with no specific arguments.
 
Method Summary
protected  String execToString(ExpressionTuple expr, FormatHelper formatHelper)
          Executes the toString operation.
 String getAlias()
          Gets the alias of the expression type.
 Number getNegative(Number number)
          Gets the negative value for the given number.
 Class getType()
          Gets the class of the expression type.
 Object typeCast(Object value)
          Casts the given value into the handler-specific type.
 
Methods inherited from class org.ujac.util.exi.type.BaseType
addOperation, evalTuple, getDescription, getOperation, getOperationNames, getOperations, getTypeName, removeAllOperations, removeOperation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FloatType

public FloatType(ExpressionInterpreter interpreter)
Constructs a FloatType instance with no specific arguments.

Parameters:
interpreter -
Method Detail

execToString

protected String execToString(ExpressionTuple expr,
                              FormatHelper formatHelper)
Executes the toString operation.

Overrides:
execToString in class BaseType
Parameters:
expr - The expression, holding the object to get as string.
formatHelper - The format helper to use.
Returns:
The textual representation of the expression value.

getType

public Class getType()
Description copied from interface: ExpressionType
Gets the class of the expression type.

Returns:
The class the expression type is valid for.
See Also:
ExpressionType.getType()

getAlias

public String getAlias()
Gets the alias of the expression type.

Specified by:
getAlias in interface ExpressionType
Overrides:
getAlias in class BaseType
Returns:
The tpye alias.

getNegative

public Number getNegative(Number number)
Gets the negative value for the given number.

Specified by:
getNegative in class BaseNumberType
Parameters:
number - The number to negate.
Returns:
The negated value of the given number.

typeCast

public Object typeCast(Object value)
                throws TypeCastException
Casts the given value into the handler-specific type.

Specified by:
typeCast in interface ExpressionType
Overrides:
typeCast in class BaseType
Parameters:
value - The value to cast.
Returns:
The transformed value.
Throws:
TypeCastException - In case the type cast failed.


Copyright © 2003-2004 UJAC.org. All Rights Reserved.