org.axiondb
Class Literal

java.lang.Object
  extended by org.axiondb.NamedIdentifier
      extended by org.axiondb.Literal
All Implemented Interfaces:
Serializable, Selectable
Direct Known Subclasses:
BindVariable, Sequence

public class Literal
extends NamedIdentifier
implements Selectable

A typedliteral value.

Version:
$Revision: 1.14 $ $Date: 2004/09/09 23:47:45 $
See Also:
Serialized Form

Constructor Summary
protected Literal(DataType type)
           
  Literal(Object value)
           
  Literal(Object value, DataType type)
           
  Literal(Object value, DataType type, String aliasName)
           
 
Method Summary
 boolean equals(Object otherobject)
          Returns true iff otherobject is a Literalwhose name are equal to mine.
 Object evaluate()
           
 Object evaluate(RowDecorator row)
           
 String getAlias()
          Returns the alias name of Literal, if any.
 DataType getDataType()
           
 String getLabel()
          Returns my Literal name.
 String getName()
          Returns the name of Literal, if any.
protected  Object getValue()
           
 int hashCode()
          Returns a hash code in keeping with the standard equals/ hashCodecontract.
 void setAlias(String name)
          Sets the name of this Literal.
 void setDataType(DataType type)
           
protected  void setValue(Object value)
           
 void setVariableContext(VariableContext context)
           
 String toString()
          Returns a String representation of me, suitable for debugging output.
 
Methods inherited from class org.axiondb.NamedIdentifier
toUpperOrNull
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Literal

public Literal(Object value)

Literal

public Literal(Object value,
               DataType type)

Literal

public Literal(Object value,
               DataType type,
               String aliasName)

Literal

protected Literal(DataType type)
Method Detail

equals

public boolean equals(Object otherobject)
Returns true iff otherobject is a Literalwhose name are equal to mine.

Overrides:
equals in class Object

evaluate

public Object evaluate()
                throws AxionException
Throws:
AxionException

evaluate

public final Object evaluate(RowDecorator row)
                      throws AxionException
Specified by:
evaluate in interface Selectable
Parameters:
row - is ignored and may be null.
Throws:
AxionException
See Also:
evaluate()

getAlias

public String getAlias()
Returns the alias name of Literal, if any.

Specified by:
getAlias in interface Selectable

getDataType

public DataType getDataType()
Specified by:
getDataType in interface Selectable

getLabel

public String getLabel()
Returns my Literal name.

Specified by:
getLabel in interface Selectable

getName

public String getName()
Returns the name of Literal, if any.

Specified by:
getName in interface Selectable

hashCode

public int hashCode()
Returns a hash code in keeping with the standard equals/ hashCodecontract.

Overrides:
hashCode in class Object

setAlias

public void setAlias(String name)
Sets the name of this Literal.


setDataType

public void setDataType(DataType type)

setVariableContext

public void setVariableContext(VariableContext context)
Specified by:
setVariableContext in interface Selectable

toString

public String toString()
Returns a String representation of me, suitable for debugging output.

Overrides:
toString in class Object

getValue

protected Object getValue()
                   throws AxionException
Throws:
AxionException

setValue

protected void setValue(Object value)