com.ibm.wala.fixedpoint.impl
Class UnaryStatement<T extends IVariable>

java.lang.Object
  extended by com.ibm.wala.util.graph.impl.NodeWithNumber
      extended by com.ibm.wala.fixedpoint.impl.AbstractStatement<T,UnaryOperator<T>>
          extended by com.ibm.wala.fixedpoint.impl.UnaryStatement<T>
All Implemented Interfaces:
IFixedPointStatement<T>, INodeWithNumber
Direct Known Subclasses:
AssignEquation, BasicUnaryStatement

public abstract class UnaryStatement<T extends IVariable>
extends AbstractStatement<T,UnaryOperator<T>>

Represents a single step, restricted to a unary operator.


Field Summary
protected  T lhs
          The operands
protected  T rhs
           
 
Constructor Summary
protected UnaryStatement(T lhs, T rhs)
          Constructor for case of one operand on the right-hand side.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 byte evaluate()
          Evaluate this equation, setting a new value for the left-hand side.
 T getLHS()
          Return the left-hand side of this equation.
 IVariable[] getOperands()
          Return the operands in this equation.
 T[] getRHS()
          returns the list of free variables appearing in the right-hand side of the statement
 T getRightHandSide()
           
 int hashCode()
          Subclasses must implement this, to prevent non-determinism.
 boolean hasVariable(T cell)
          Does this equation contain an appearance of a given cell?
 java.lang.String toString()
          Return a string representation of this object
 
Methods inherited from class com.ibm.wala.fixedpoint.impl.AbstractStatement
getOperator, getOrderNumber
 
Methods inherited from class com.ibm.wala.util.graph.impl.NodeWithNumber
getGraphNodeId, setGraphNodeId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ibm.wala.util.graph.INodeWithNumber
getGraphNodeId, setGraphNodeId
 

Field Detail

lhs

protected final T extends IVariable lhs
The operands


rhs

protected final T extends IVariable rhs
Constructor Detail

UnaryStatement

protected UnaryStatement(T lhs,
                         T rhs)
Constructor for case of one operand on the right-hand side.

Parameters:
lhs - the lattice cell set by this equation
rhs - the first operand on the rhs
Method Detail

evaluate

public byte evaluate()
Evaluate this equation, setting a new value for the left-hand side.

Returns:
true if the lhs value changed. false otherwise

getLHS

public T getLHS()
Return the left-hand side of this equation.

Returns:
the lattice cell this equation computes

getRightHandSide

public T getRightHandSide()
Returns:
the right-hand side of this equation.

getOperands

public IVariable[] getOperands()
Return the operands in this equation.


hasVariable

public boolean hasVariable(T cell)
Does this equation contain an appearance of a given cell?

Parameters:
cell - the cell in question
Returns:
true or false

toString

public java.lang.String toString()
Return a string representation of this object

Overrides:
toString in class AbstractStatement<T extends IVariable,UnaryOperator<T extends IVariable>>
Returns:
a string representation of this object

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in class AbstractStatement<T extends IVariable,UnaryOperator<T extends IVariable>>

hashCode

public int hashCode()
Description copied from class: AbstractStatement
Subclasses must implement this, to prevent non-determinism.

Specified by:
hashCode in class AbstractStatement<T extends IVariable,UnaryOperator<T extends IVariable>>

getRHS

public T[] getRHS()
                             throws java.lang.UnsupportedOperationException
Description copied from interface: IFixedPointStatement
returns the list of free variables appearing in the right-hand side of the statement

Throws:
java.lang.UnsupportedOperationException