Package daikon

Class DynamicConstants.Constant

  • All Implemented Interfaces:
    Serializable
    Enclosing class:
    DynamicConstants

    @Interned
    public static class DynamicConstants.Constant
    extends Object
    implements Serializable
    Class used to indicate, for each variable, whether it is constant (see boolean field "constant"). If it is, then the class also stores its constant value and its sample count.

    Note that two objects of this class are equal if they refer to the same variable. This allows these to be stored in sets.

    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      int count
      The sample count of the constant.
      @MonotonicNonNull @Interned Object val
      The value of the constant, or the previous constant value if constant==false and previously_constant==true.
      VarInfo vi
      The variable that has this value.
    • Constructor Summary

      Constructors 
      Constructor Description
      Constant​(VarInfo vi)
      Creates a new Constant, indicating whether the given variable is a constant.
    • Field Detail

      • val

        public @MonotonicNonNull @Interned Object val
        The value of the constant, or the previous constant value if constant==false and previously_constant==true. Null iff count=0.
      • count

        public int count
        The sample count of the constant.
      • vi

        public VarInfo vi
        The variable that has this value.
    • Constructor Detail

      • Constant

        public Constant​(VarInfo vi)
        Creates a new Constant, indicating whether the given variable is a constant.
        Parameters:
        vi - the variable that might be a constant
    • Method Detail

      • checkRep

        public void checkRep()
        Check representation invariant.
      • is_prev_constant

        @Pure
        public boolean is_prev_constant()
        Returns whether the specified variable is currently a constant OR was a constant at the beginning of constants processing.
      • equals

        @EnsuresNonNullIf(result=true,
                          expression="#1")
        @Pure
        public boolean equals​(@GuardSatisfied DynamicConstants.Constant this,
                              @GuardSatisfied @Nullable Object obj)
        Overrides:
        equals in class Object
      • hashCode

        @Pure
        public int hashCode​(@GuardSatisfied DynamicConstants.Constant this)
        Overrides:
        hashCode in class Object
      • toString

        @SideEffectFree
        public String toString​(@GuardSatisfied DynamicConstants.Constant this)
        Overrides:
        toString in class Object