Class Constant
java.lang.Object
org.checkerframework.dataflow.constantpropagation.Constant
- All Implemented Interfaces:
AbstractValue<Constant>
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected final Constant.Type
What kind of abstract value is this?The value of this abstract value (or null). -
Constructor Summary
ConstructorDescriptionCreate a constant forvalue
.Constant
(Constant.Type type) Create a constant fortype
. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
boolean
getValue()
Returns the value.int
hashCode()
boolean
isBottom()
Returns whether or not the constant is BOTTOM.boolean
Returns whether or not the constant is CONSTANT.boolean
isTop()
Returns whether or not the constant is TOP.leastUpperBound
(Constant other) Compute the least upper bound of two values.toString()
-
Field Details
-
type
What kind of abstract value is this? -
value
The value of this abstract value (or null).
-
-
Constructor Details
-
Constant
Create a constant fortype
. -
Constant
Create a constant forvalue
.
-
-
Method Details
-
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
Returns whether or not the constant is CONSTANT.- Returns:
- whether or not the constant is CONSTANT
-
getValue
Returns the value.- Returns:
- the value
-
copy
-
leastUpperBound
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 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
-