edu.neu.ccs.parser
Class ObjectOperationPair

java.lang.Object
  extended byedu.neu.ccs.parser.ObjectOperationPair

public class ObjectOperationPair
extends Object

Pair class used by AbstractParser to store a value and an associated operation. The value is viewed as the left operand of the operation and the operation is viewed as pending the acquisition of its right operand.

The operation may be null to signal that no more operations have been found to process in the current parsing phase.

If the operation is non-null and can accept null as a left operand then the value may be null.

As of 2.5.0, this class was extracted from the class AbstractParser and made standalone.


Field Summary
private  Operation operation
          The operation component of the pair.
private  Object value
          The object component of the pair.
 
Constructor Summary
ObjectOperationPair()
          Constructs a default initial ObjectOperationPair whose value is null and whose Operation is Operation.IDENTITY.
ObjectOperationPair(Object v, Operation o)
          Constructs a pair with the given value and operation.
 
Method Summary
 Operation operation()
          Returns the operation component of this pair.
 Object value()
          Returns the value component of this pair.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

value

private Object value
The object component of the pair.


operation

private Operation operation
The operation component of the pair.

Constructor Detail

ObjectOperationPair

public ObjectOperationPair()

Constructs a default initial ObjectOperationPair whose value is null and whose Operation is Operation.IDENTITY.

Such a pair is used to start the parse method in BaseParser.


ObjectOperationPair

public ObjectOperationPair(Object v,
                           Operation o)

Constructs a pair with the given value and operation.

Parameters:
v - the value component
o - the operation component
Method Detail

value

public Object value()
Returns the value component of this pair.


operation

public Operation operation()
Returns the operation component of this pair.