java.lang.Object
org.checkerframework.dataflow.constantpropagation.Constant
All Implemented Interfaces:
AbstractValue<Constant>

public class Constant extends Object implements AbstractValue<Constant>
  • Field Details Link icon

    • type Link icon

      protected final Constant.Type type
      What kind of abstract value is this?
    • value Link icon

      protected @Nullable Integer value
      The value of this abstract value (or null).
  • Constructor Details Link icon

    • Constant Link icon

      public Constant(Constant.Type type)
      Create a constant for type.
    • Constant Link icon

      public Constant(Integer value)
      Create a constant for value.
  • Method Details Link icon

    • isTop Link icon

      public boolean isTop()
      Returns whether or not the constant is TOP.
      Returns:
      whether or not the constant is TOP
    • isBottom Link icon

      public boolean isBottom()
      Returns whether or not the constant is BOTTOM.
      Returns:
      whether or not the constant is BOTTOM
    • isConstant Link icon

      @EnsuresNonNullIf(result=true, expression="value") public boolean isConstant()
      Returns whether or not the constant is CONSTANT.
      Returns:
      whether or not the constant is CONSTANT
    • getValue Link icon

      public Integer getValue()
      Returns the value.
      Returns:
      the value
    • copy Link icon

      public Constant copy()
    • leastUpperBound Link icon

      public Constant leastUpperBound(Constant other)
      Description copied from interface: AbstractValue
      Compute the least upper bound of two values.

      Important: This method must fulfill the following contract:

      • Does not change this.
      • Does not change other.
      • Returns a fresh object which is not aliased yet.
      • Returns an object of the same (dynamic) type as this, even if the signature is more permissive.
      • Is commutative.
      Specified by:
      leastUpperBound in interface AbstractValue<Constant>
      Parameters:
      other - the other value
      Returns:
      the least upper bound of the two values
    • equals Link icon

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • hashCode Link icon

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object