org.teatrove.tea.parsetree
Class BooleanLiteral
java.lang.Object
org.teatrove.tea.parsetree.Node
org.teatrove.tea.parsetree.Expression
org.teatrove.tea.parsetree.Literal
org.teatrove.tea.parsetree.BooleanLiteral
- All Implemented Interfaces:
- Serializable, Cloneable
public class BooleanLiteral
- extends Literal
BooleanLiterals can only have one of two values, true or false.
- Author:
- Brian S O'Neill
- See Also:
- Serialized Form
|
Method Summary |
Object |
accept(NodeVisitor visitor)
Every subclass of Node must override this method with the following:
return visitor.visit(this). |
void |
convertTo(Type type,
boolean preferCast)
Applies a type conversion to this expression which is chained to all
previous conversions. |
Object |
getValue()
Most expressions can't generate a value at compile-time, so this
method simply returns null. |
void |
setType(Type type)
Sets the type of this expression, clearing the conversion chain. |
BooleanLiteral
public BooleanLiteral(SourceInfo info,
boolean value)
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 Literal
- Parameters:
visitor - A visitor of this Node
- Returns:
- Node The Node returned by the visitor
- See Also:
NodeVisitor
convertTo
public void convertTo(Type type,
boolean preferCast)
- Description copied from class:
Expression
- Applies a type conversion to this expression which is chained to all
previous conversions.
- Overrides:
convertTo in class Expression
- Parameters:
type - the type to convert to.preferCast - a hint that the conversion should be performed by a
type cast operation, by default is true.
setType
public void setType(Type type)
- Description copied from class:
Expression
- Sets the type of this expression, clearing the conversion chain.
- Overrides:
setType in class Expression
getValue
public Object getValue()
- Description copied from class:
Expression
- Most expressions can't generate a value at compile-time, so this
method simply returns null. Call isValueKnown to check if the
expression's value is known at compile-time.
- Overrides:
getValue in class Expression
Copyright © 1997-2012 TeaTrove.org. All Rights Reserved.