Interface EquivTo

All Known Subinterfaces:
BranchingStmt, ComparableConstant<C>, ConcreteRef, Constant, Expr, FallsThroughStmt, IdentityRef, Immediate, InvokableStmt, LogicalConstant<L>, LValue, NumericConstant<N>, RealConstant<R>, Ref, ReturnStmt, ShiftableConstant<A>, Stmt, Value
All Known Implementing Classes:
AbstractBinopExpr, AbstractConditionExpr, AbstractDefinitionStmt, AbstractFloatBinopExpr, AbstractInstanceInvokeExpr, AbstractIntBinopExpr, AbstractIntLongBinopExpr, AbstractInvokeExpr, AbstractStmt, AbstractUnopExpr, BooleanConstant, ClassConstant, DoubleConstant, EnumConstant, FloatConstant, IntConstant, JAddExpr, JAndExpr, JArrayRef, JAssignStmt, JavaLocal, JBreakpointStmt, JCastExpr, JCaughtExceptionRef, JCmpExpr, JCmpgExpr, JCmplExpr, JDivExpr, JDynamicInvokeExpr, JEnterMonitorStmt, JEqExpr, JExitMonitorStmt, JFieldRef, JGeExpr, JGotoStmt, JGtExpr, JIdentityStmt, JIfStmt, JInstanceFieldRef, JInstanceOfExpr, JInterfaceInvokeExpr, JInvokeStmt, JLeExpr, JLengthExpr, JLtExpr, JMulExpr, JNeExpr, JNegExpr, JNewArrayExpr, JNewExpr, JNewMultiArrayExpr, JNopStmt, JOrExpr, JParameterRef, JPhiExpr, JRemExpr, JRetStmt, JReturnStmt, JReturnVoidStmt, JShlExpr, JShrExpr, JSpecialInvokeExpr, JStaticFieldRef, JStaticInvokeExpr, JSubExpr, JSwitchStmt, JThisRef, JThrowStmt, JUshrExpr, JVirtualInvokeExpr, JXorExpr, Local, LongConstant, MethodHandle, MethodType, NullConstant, StringConstant

public interface EquivTo
An alternate equivalence relation between objects, not necessarily compliant with the contract defined by Object.equals(Object). The standard interpretation will be structural equality. We also demand that if x.equivTo(y), then x.equivHashCode() == y.equivHashCode.

See JimpleComparator for the detailed contract.

  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns a (not necessarily fixed) hash code for this object.
    default boolean
    Returns true if this object is equivalent to o.
    boolean
    equivTo(Object o, @NonNull JimpleComparator comparator)
    Returns true if this object is equivalent to o according to the given comparator.
  • Method Details

    • equivTo

      default boolean equivTo(Object o)
      Returns true if this object is equivalent to o. The contract is defined in JimpleComparator and is not necessarily compliant with the contract * defined by Object.equals(Object).
      Parameters:
      o - the object to compare with
      Returns:
      true if this object is structurally equivalent to o
    • equivHashCode

      int equivHashCode()
      Returns a (not necessarily fixed) hash code for this object. This hash code coincides with equivTo; it is undefined in the presence of mutable objects. The contract is defined in JimpleComparator.
      Returns:
      a structural hash code consistent with equivTo
    • equivTo

      boolean equivTo(Object o, @NonNull JimpleComparator comparator)
      Returns true if this object is equivalent to o according to the given comparator.
      Parameters:
      o - the object to compare with
      comparator - the comparator defining the equivalence relation
      Returns:
      true if this object is structurally equivalent to o under the given comparator