org.ujac.util.exi.type
Class IntegerType

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.IntegerType
All Implemented Interfaces:
ExpressionType

public class IntegerType
extends BaseNumberType

Name: IntegerType
Description: An expression type handler for int values.

Author:
lauerc

Nested Class Summary
 class IntegerType.AbsOperation
          The 'abs' operation for Integers.
 class IntegerType.AddOperation
          The 'add' operation for Integers.
 class IntegerType.DivOperation
          The 'div' operation for Integers.
 class IntegerType.EqualOperation
          The equal compare operation for Integers.
 class IntegerType.GreaterEqualOperation
          The 'greater equal' compare operation for Integers.
 class IntegerType.GreaterOperation
          The 'greater' compare operation for Integers.
 class IntegerType.LessEqualOperation
          The 'less equal' compare operation for Integers.
 class IntegerType.LessOperation
          The 'less' compare operation for Integers.
 class IntegerType.MaxOperation
          The 'max' operation for Integers.
 class IntegerType.MinOperation
          The 'min' operation for Integers.
 class IntegerType.ModOperation
          The 'mod' operation for Integers.
 class IntegerType.MulOperation
          The 'mul' operation for Integers.
 class IntegerType.NotEqualOperation
          The 'not equal' compare operation for Integers.
 class IntegerType.SubOperation
          The 'sub' operation for Integers.
 
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
IntegerType(ExpressionInterpreter interpreter, Class clazz, String alias)
          Constructs a IntegerType 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

IntegerType

public IntegerType(ExpressionInterpreter interpreter,
                   Class clazz,
                   String alias)
Constructs a IntegerType instance with no specific arguments.

Parameters:
interpreter - The expression interpreter.
clazz - The class this handler gets registered for.
alias - The type alias.
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.