org.ujac.util.exi.type
Class ByteType

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

public class ByteType
extends BaseNumberType

Name: ByteType
Description: An expression type handler for byte values.

Author:
lauerc

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

ByteType

public ByteType(ExpressionInterpreter interpreter)
Constructs a ShortType 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.