de.mguennewig.pobjects
Class Cast

java.lang.Object
  extended by de.mguennewig.pobjects.Cast
All Implemented Interfaces:
Term

public class Cast
extends java.lang.Object
implements Term

A type cast of an SQL expression.

Author:
Michael Günnewig

Constructor Summary
Cast(Term expr, Type type)
          Creates a new Cast.
 
Method Summary
static Cast castToString(Term expr)
           
 boolean equals(java.lang.Object o)
          
 Term getExpression()
          Returns the expression whose type has to be casted.
 java.lang.String getSqlValue(EvalContext eval)
          Returns the SQL expression for this term.
 Type getType()
          Returns the type to which the expression has to be casted.
 int hashCode()
          
 boolean isConstant()
          Tests whether the cast can be evaluated without an object.
 boolean isJoin()
          Tests whether this expression enforces any kind of join.
 boolean isSelection()
          Tests whether this expression is a selection.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Cast

public Cast(Term expr,
            Type type)
Creates a new Cast.

Method Detail

equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class java.lang.Object

getExpression

public final Term getExpression()
Returns the expression whose type has to be casted.


getType

public final Type getType()
Returns the type to which the expression has to be casted.


getSqlValue

public java.lang.String getSqlValue(EvalContext eval)
Returns the SQL expression for this term.

Specified by:
getSqlValue in interface Term

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

isConstant

public final boolean isConstant()
Tests whether the cast can be evaluated without an object.

Specified by:
isConstant in interface Term

isJoin

public final boolean isJoin()
Description copied from interface: Term
Tests whether this expression enforces any kind of join.

Specified by:
isJoin in interface Term

isSelection

public final boolean isSelection()
Description copied from interface: Term
Tests whether this expression is a selection.

With selection is an expression meant that binds a Member to one Literal.

Specified by:
isSelection in interface Term

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

castToString

public static Cast castToString(Term expr)