Package soot.toolkits.scalar
Class ValueUnitPair
- java.lang.Object
-
- soot.tagkit.AbstractHost
-
- soot.AbstractValueBox
-
- soot.toolkits.scalar.ValueUnitPair
-
- All Implemented Interfaces:
Serializable,EquivTo,Host,UnitBox,ValueBox
- Direct Known Subclasses:
SValueUnitPair
public class ValueUnitPair extends AbstractValueBox implements UnitBox, EquivTo
Utility class used to package a Value and a Unit together.- Author:
- Navindra Umanee
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Unitunit-
Fields inherited from class soot.AbstractValueBox
value
-
Fields inherited from class soot.tagkit.AbstractHost
col, line, mTagList
-
-
Constructor Summary
Constructors Constructor Description ValueUnitPair(Value value, Unit unit)Constructs a ValueUnitPair from a Unit object and a Value object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanContainUnit(Unit u)Returns true if this box can contain the given Unit.booleancanContainValue(Value value)Returns true if the given Value fits in this box.Objectclone()booleanequals(Object other)intequivHashCode()Non-deterministic hashcode consistent with equivTo() implementation.booleanequivTo(Object other)Two ValueUnitPairs are equivTo iff they hold the same Unit objects and equivalent Value objects within them.UnitgetUnit()Returns the unit contained within this box.inthashCode()booleanisBranchTarget()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).voidsetUnit(Unit unit)Sets this box to contain the given unit.StringtoString()voidtoString(UnitPrinter up)-
Methods inherited from class soot.AbstractValueBox
getValue, setValue
-
Methods inherited from class soot.tagkit.AbstractHost
addAllTagsOf, addTag, getJavaSourceStartColumnNumber, getJavaSourceStartLineNumber, getTag, getTags, hasTag, removeAllTags, removeTag
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface soot.tagkit.Host
addAllTagsOf, addTag, getJavaSourceStartColumnNumber, getJavaSourceStartLineNumber, getTag, getTags, hasTag, removeAllTags, removeTag
-
-
-
-
Field Detail
-
unit
protected Unit unit
-
-
Method Detail
-
canContainValue
public boolean canContainValue(Value value)
Description copied from interface:ValueBoxReturns true if the given Value fits in this box.- Specified by:
canContainValuein interfaceValueBox
-
setUnit
public void setUnit(Unit unit)
Description copied from interface:UnitBoxSets this box to contain the given unit. Subject to canContainValue() checks.- Specified by:
setUnitin interfaceUnitBox- See Also:
UnitBox.setUnit(Unit)
-
getUnit
public Unit getUnit()
Description copied from interface:UnitBoxReturns the unit contained within this box.- Specified by:
getUnitin interfaceUnitBox- See Also:
UnitBox.getUnit()
-
canContainUnit
public boolean canContainUnit(Unit u)
Description copied from interface:UnitBoxReturns true if this box can contain the given Unit.- Specified by:
canContainUnitin interfaceUnitBox- See Also:
UnitBox.canContainUnit(Unit)
-
isBranchTarget
public boolean isBranchTarget()
Description copied from interface:UnitBoxReturns 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). This is the default case.Returns false if the UnitBox is holding a Unit that indicates the end of a CFG block and may require specialised processing for SSA.
- Specified by:
isBranchTargetin interfaceUnitBox- See Also:
UnitBox.isBranchTarget()
-
toString
public String toString()
- Overrides:
toStringin classAbstractValueBox
-
toString
public void toString(UnitPrinter up)
-
equivTo
public boolean equivTo(Object other)
Two ValueUnitPairs are equivTo iff they hold the same Unit objects and equivalent Value objects within them.
-
equivHashCode
public int equivHashCode()
Non-deterministic hashcode consistent with equivTo() implementation.Note: If you are concerned about non-determinism, remember that current implementations of equivHashCode() in other parts of Soot are non-deterministic as well (see Constant.java for example).
- Specified by:
equivHashCodein interfaceEquivTo
-
-