wugle.expression
Class AbstractExpression

java.lang.Object
  |
  +--wugle.expression.AbstractExpression
All Implemented Interfaces:
java.lang.Cloneable, Expression
Direct Known Subclasses:
AbstractBinaryOperator, AbstractUnaryOperator, AbstractValue

public abstract class AbstractExpression
extends java.lang.Object
implements Expression

An abstract implementation of Expression.

AbstractExpression provides a basic implementation of Expression, but is not meant to be a full class. Subclasses should implement appropriate sub-interfaces of Expression in order to define properties and operations.

Version:
0.1.3
Author:
Jacob Perkins

Field Summary
protected  org.apache.log4j.Logger log
          Logger for logging messages
protected  ExpressionOperation operation
          Object for delegating operations to.
 
Constructor Summary
AbstractExpression(java.lang.String symbol, ExpressionOperation operation)
          Initializes the Expression with a symbol and an ExpressionOperation.
 
Method Summary
 java.lang.Object clone()
          Returns a copy of this Expression.
 Operator getParent()
          Gets the parent Operator, or null if there is no parent.
 java.lang.String getSymbol()
          Gets the Expression's symbol.
 void setParent(Operator parent)
          Sets the parent Operator.
 java.lang.String toString()
          Gets the String representation of the Expression.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface wugle.expression.Expression
isEqual
 

Field Detail

log

protected org.apache.log4j.Logger log
Logger for logging messages


operation

protected ExpressionOperation operation
Object for delegating operations to.

Subclasses can use this object for delegating implemented operations.

Constructor Detail

AbstractExpression

public AbstractExpression(java.lang.String symbol,
                          ExpressionOperation operation)
Initializes the Expression with a symbol and an ExpressionOperation.

Parameters:
symbol - Symbol representing the Expression
operation - Object for delegating operations to
See Also:
operation
Method Detail

toString

public java.lang.String toString()
Gets the String representation of the Expression.

Overrides:
toString in class java.lang.Object
Returns:
The symbol representing the Expression
See Also:
getSymbol()

clone

public java.lang.Object clone()
Description copied from interface: Expression
Returns a copy of this Expression.

Specified by:
clone in interface Expression
Overrides:
clone in class java.lang.Object
Returns:
Copy of the Expression

getParent

public Operator getParent()
Description copied from interface: Expression
Gets the parent Operator, or null if there is no parent.

Specified by:
getParent in interface Expression
Returns:
Parent Operator

setParent

public void setParent(Operator parent)
Description copied from interface: Expression
Sets the parent Operator.

Specified by:
setParent in interface Expression
Parameters:
parent - Parent Operator, or null for no parent

getSymbol

public java.lang.String getSymbol()
Description copied from interface: Expression
Gets the Expression's symbol.

Specified by:
getSymbol in interface Expression
Returns:
String representing the Expression