org.teatrove.tea.parsetree
Class Literal

java.lang.Object
  extended by org.teatrove.tea.parsetree.Node
      extended by org.teatrove.tea.parsetree.Expression
          extended by org.teatrove.tea.parsetree.Literal
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
BooleanLiteral, NullLiteral, NumberLiteral, StringLiteral

public abstract class Literal
extends Expression

A literal is an expression that has a constant value.

Author:
Brian S O'Neill
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.teatrove.tea.parsetree.Expression
Expression.Conversion
 
Constructor Summary
protected Literal(SourceInfo info)
           
 
Method Summary
 Object accept(NodeVisitor visitor)
          Every subclass of Node must override this method with the following: return visitor.visit(this).
 boolean isValueKnown()
          Usually returns true, but some literals may have an unknown value if they are converted to another type.
 
Methods inherited from class org.teatrove.tea.parsetree.Expression
clone, convertTo, convertTo, forceConversion, getConversionChain, getInitialType, getType, getValue, isExceptionPossible, setInitialType, setType
 
Methods inherited from class org.teatrove.tea.parsetree.Node
getSourceInfo, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Literal

protected Literal(SourceInfo info)
Method Detail

accept

public Object accept(NodeVisitor visitor)
Description copied from class: Node
Every subclass of Node must override this method with the following: return visitor.visit(this).

Overrides:
accept in class Expression
Parameters:
visitor - A visitor of this Node
Returns:
Node The Node returned by the visitor
See Also:
NodeVisitor

isValueKnown

public boolean isValueKnown()
Usually returns true, but some literals may have an unknown value if they are converted to another type.

Overrides:
isValueKnown in class Expression
See Also:
Literal


Copyright © 1997-2012 TeaTrove.org. All Rights Reserved.