Class Constant
java.lang.Object
org.checkerframework.dataflow.constantpropagation.Constant
- All Implemented Interfaces:
AbstractValue<Constant>
An abstract value for constant propagation: a known integer constant, top, or bottom.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Constant.TypeThe kind of this abstract value.The value of this abstract value (or null). -
Constructor Summary
ConstructorsConstructorDescriptionCreates a constant forvalue.Constant(Constant.Type type) Creates a constant fortype. -
Method Summary
Modifier and TypeMethodDescriptioncopy()booleangetValue()Returns the value.inthashCode()booleanisBottom()Returns true if the constant is BOTTOM.booleanReturns true if the constant is CONSTANT.booleanisTop()Returns true if the constant is TOP.leastUpperBound(Constant other) Computes the least upper bound of two values.toString()
-
Field Details
-
type
The kind of this abstract value. -
value
The value of this abstract value (or null).
-
-
Constructor Details
-
Constant
Creates a constant fortype.- Parameters:
type- the kind of this abstract value; must not beCONSTANT
-
Constant
Creates a constant forvalue.- Parameters:
value- the integer value of this constant
-
-
Method Details
-
isTop
public boolean isTop()Returns true if the constant is TOP.- Returns:
- true if the constant is TOP
-
isBottom
public boolean isBottom()Returns true if the constant is BOTTOM.- Returns:
- true if the constant is BOTTOM
-
isConstant
Returns true if the constant is CONSTANT.- Returns:
- true if the constant is CONSTANT
-
getValue
Returns the value.- Returns:
- the value
-
copy
-
leastUpperBound
Description copied from interface:AbstractValueComputes 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>- Parameters:
other- the other value- Returns:
- the least upper bound of the two values
- Does not change
-
equals
-
hashCode
public int hashCode() -
toString
-