Class Constant
- java.lang.Object
-
- org.checkerframework.dataflow.constantpropagation.Constant
-
- All Implemented Interfaces:
AbstractValue<Constant>
public class Constant extends java.lang.Object implements AbstractValue<Constant>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classConstant.Type
-
Field Summary
Fields Modifier and Type Field Description protected Constant.TypetypeWhat kind of abstract value is this?protected @Nullable java.lang.IntegervalueThe value of this abstract value (or null).
-
Constructor Summary
Constructors Constructor Description Constant(java.lang.Integer value)Create a constant forvalue.Constant(Constant.Type type)Create a constant fortype.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Constantcopy()booleanequals(@Nullable java.lang.Object obj)java.lang.IntegergetValue()Returns the value.inthashCode()booleanisBottom()Returns whether or not the constant is BOTTOM.booleanisConstant()Returns whether or not the constant is CONSTANT.booleanisTop()Returns whether or not the constant is TOP.ConstantleastUpperBound(Constant other)Compute the least upper bound of two values.java.lang.StringtoString()
-
-
-
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 fortype.
-
Constant
public Constant(java.lang.Integer value)
Create a constant forvalue.
-
-
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
-
copy
public Constant copy()
-
leastUpperBound
public Constant leastUpperBound(Constant other)
Description copied from interface:AbstractValueCompute 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:
leastUpperBoundin interfaceAbstractValue<Constant>
- Does not change
-
equals
public boolean equals(@Nullable java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-