org.ujac.util.exi.type
Class TimeType

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

public class TimeType
extends BaseDateType

Name: TimeType
Description: An expression type handler for Time values.

Author:
lauerc

Nested Class Summary
 
Nested classes/interfaces inherited from class org.ujac.util.exi.type.BaseDateType
BaseDateType.BeginOfYearOperation, BaseDateType.DecrementDayOperation, BaseDateType.DecrementMonthOperation, BaseDateType.DecrementYearOperation, BaseDateType.EndOfYearOperation, BaseDateType.EqualOperation, BaseDateType.FormatOperation, BaseDateType.GetDayOperation, BaseDateType.GetMonthOperation, BaseDateType.GetYearOperation, BaseDateType.GreaterEqualOperation, BaseDateType.GreaterOperation, BaseDateType.IncrementDayOperation, BaseDateType.IncrementMonthOperation, BaseDateType.IncrementYearOperation, BaseDateType.LessEqualOperation, BaseDateType.LessOperation, BaseDateType.MaxOperation, BaseDateType.MinOperation, BaseDateType.NextUltimoOperation, BaseDateType.NotEqualOperation, BaseDateType.PreviousUltimoOperation, BaseDateType.ReferenceOperation, BaseDateType.SetDayOperation, BaseDateType.SetMonthOperation, BaseDateType.SetYearOperation
 
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
TimeType(ExpressionInterpreter interpreter)
          Constructs a TimeType instance with specific arguments.
 
Method Summary
protected  int compareDates(Date object, Date operand)
          Compares the given date instances.
protected  Date evalDate(Operand operand, ExpressionContext ctx)
          Evaluates the given operand to a Date value.
protected  String execToString(ExpressionTuple expr, FormatHelper formatHelper)
          Executes the toString operation.
 String getAlias()
          Gets the alias of the expression type.
 Class getType()
          Gets the class of the expression type.
 
Methods inherited from class org.ujac.util.exi.type.BaseType
addOperation, evalTuple, getDescription, getOperation, getOperationNames, getOperations, getTypeName, removeAllOperations, removeOperation, typeCast
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeType

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

Parameters:
interpreter - The expression interpreter.
Method Detail

execToString

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

Specified by:
execToString in class BaseDateType
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.

evalDate

protected Date evalDate(Operand operand,
                        ExpressionContext ctx)
                 throws ExpressionException
Evaluates the given operand to a Date value.

Specified by:
evalDate in class BaseDateType
Parameters:
operand - The operand to evaluate.
ctx - The expression context.
Returns:
The evaluated Date value.
Throws:
ExpressionException - In case the evaluation failed.

compareDates

protected int compareDates(Date object,
                           Date operand)
Compares the given date instances.

Specified by:
compareDates in class BaseDateType
Parameters:
object - The object to compare.
operand - The operand to compare.
Returns:
1 in case the object is bigger than the operand, 0 if object and operand equals -1 in case the object is smaller than the operand.

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.


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