Class ValueUnitPair

    • Field Detail

      • unit

        protected Unit unit
    • 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.
        Specified by:
        canContainValue in interface ValueBox
      • setUnit

        public void setUnit​(Unit unit)
        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)
      • 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). 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:
        isBranchTarget in interface UnitBox
        See Also:
        UnitBox.isBranchTarget()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • equivTo

        public boolean equivTo​(Object other)
        Two ValueUnitPairs are equivTo iff they hold the same Unit objects and equivalent Value objects within them.
        Specified by:
        equivTo in interface EquivTo
        Parameters:
        other - another ValueUnitPair
        Returns:
        true if other contains the same objects as this.
      • 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:
        equivHashCode in interface EquivTo