soot.toolkits.scalar
Class ValueUnitPair

java.lang.Object
  |
  +--soot.tagkit.AbstractHost
        |
        +--soot.AbstractValueBox
              |
              +--soot.toolkits.scalar.ValueUnitPair
Direct Known Subclasses:
SValueUnitPair

public class ValueUnitPair
extends AbstractValueBox
implements UnitBox

Utility class used to package a Value and a Unit together.

See Also:
Serialized Form

Field Summary
protected  UnitBox oub
           
 
Constructor Summary
ValueUnitPair(Value value, Unit unit)
          Constructs a ValueUnitPair from a Unit object and a Value object.
 
Method Summary
 boolean canContainUnit(Unit u)
          Returns true if this box can contain the given Unit.
 boolean canContainValue(Value value)
          Returns true if the given Value fits in this box.
 java.lang.Object clone()
           
 boolean equals(java.lang.Object other)
           
 boolean equivTo(java.lang.Object other)
          Two ValueUnitPairs are equivTo iff they hold the same Unit objects and the same Value objects within them.
 Unit getUnit()
          Returns the unit contained within this box.
 int hashCode()
           
 boolean isBranchTarget()
          Returns true if the UnitBox is holding a Unit that is the target of a branch (ie a Unit at the beginning of a CFG block).
 void setBranchTarget(boolean branchTarget)
          If not set, this is normally assumed to be true by default.
 void setUnit(Unit u)
          Sets this box to contain the given unit.
 java.lang.String toString()
           
 void toString(UnitPrinter up)
           
 
Methods inherited from class soot.AbstractValueBox
getValue, setValue
 
Methods inherited from class soot.tagkit.AbstractHost
addAllTagsOf, addTag, getTag, getTags, hasTag, removeAllTags, removeTag
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

oub

protected UnitBox oub
Constructor Detail

ValueUnitPair

public ValueUnitPair(Value value,
                     Unit unit)
Constructs a ValueUnitPair from a Unit object and a Value object.
Parameters:
value - some Value
unit - some Unit.
Method Detail

canContainValue

public boolean canContainValue(Value value)
Description copied from interface: ValueBox
Returns true if the given Value fits in this box.

setUnit

public void setUnit(Unit u)
Description copied from interface: UnitBox
Sets this box to contain the given unit. Subject to canContainValue() checks.
Specified by:
setUnit in interface UnitBox
See Also:
UnitBox.setUnit(Unit)

getUnit

public Unit getUnit()
Description copied from interface: UnitBox
Returns the unit contained within this box.
Specified by:
getUnit in interface UnitBox
See Also:
UnitBox.getUnit()

canContainUnit

public boolean canContainUnit(Unit u)
Description copied from interface: UnitBox
Returns true if this box can contain the given Unit.
Specified by:
canContainUnit in interface UnitBox
See Also:
UnitBox.canContainUnit(Unit)

isBranchTarget

public boolean isBranchTarget()
Description copied from interface: UnitBox
Returns true if the UnitBox is holding a Unit that is the target of a branch (ie a Unit at the beginning of a CFG block). Returns false if the UnitBox is holding a Unit that indicates the end of a CFG block (used by SSA to locate CFG predecessors).
Specified by:
isBranchTarget in interface UnitBox
See Also:
UnitBox.isBranchTarget()

setBranchTarget

public void setBranchTarget(boolean branchTarget)
Description copied from interface: UnitBox
If not set, this is normally assumed to be true by default.
Specified by:
setBranchTarget in interface UnitBox
See Also:
UnitBox.setBranchTarget(boolean)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public void toString(UnitPrinter up)
Specified by:
toString in interface UnitBox
Overrides:
toString in class AbstractValueBox

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

equivTo

public boolean equivTo(java.lang.Object other)
Two ValueUnitPairs are equivTo iff they hold the same Unit objects and the same Value objects within them.
Parameters:
other - another ValueUnitPair
Returns:
true if other contains the same objects as this.

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object