Class Constant

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Constant.Type  
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected Constant.Type type
      What kind of abstract value is this?
      protected @Nullable java.lang.Integer value
      The value of this abstract value (or null).
    • Constructor Summary

      Constructors 
      Constructor Description
      Constant​(java.lang.Integer value)
      Create a constant for value.
      Constant​(Constant.Type type)
      Create a constant for type.
    • Field Detail

      • type

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

        protected @Nullable java.lang.Integer value
        The value of this abstract value (or null).
    • Constructor Detail

      • Constant

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

        public Constant​(java.lang.Integer value)
        Create a constant for value.
    • Method Detail

      • isTop

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

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

        @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

        public java.lang.Integer getValue()
        Returns the value.
        Returns:
        the value
      • leastUpperBound

        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>
      • equals

        public boolean equals​(@Nullable java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object