- All Superinterfaces:
Comparable<NumberObject>,SymbolicObject
A symbolic object wrapping a single instance of
Number.-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.civl.sarl.IF.object.SymbolicObject
SymbolicObject.SymbolicObjectKind -
Method Summary
Modifier and TypeMethodDescriptionGet the underlying Number.booleanDoes the number have integer type? (Note: a rational number which is integer, e.g., "2/1", does not have integer type.)booleanisOne()Convenience method to determine whether this concrete expression is 1.booleanisReal()Does the number have real (not integer) type?booleanisZero()Convenience method to determine whether this concrete expression is 0.intsignum()Returns either -1, 0, or +1, depending on whether the value of this expression is invalid input: '<'0, 0, or >0 (respectively).Methods inherited from interface java.lang.Comparable
compareToMethods inherited from interface dev.civl.sarl.IF.object.SymbolicObject
containsQuantifier, containsSubobject, containsSubobjectIgnoringType, equals, getOrder, hashCode, id, isCanonic, setInCanonic, setOrder, symbolicObjectKind, toString, toStringBuffer, toStringBufferLong
-
Method Details
-
getNumber
Number getNumber()Get the underlying Number.- Returns:
- the Number wrapped by this object
-
signum
int signum()Returns either -1, 0, or +1, depending on whether the value of this expression is invalid input: '<'0, 0, or >0 (respectively). -
isZero
boolean isZero()Convenience method to determine whether this concrete expression is 0. Works for integer or real types. -
isOne
boolean isOne()Convenience method to determine whether this concrete expression is 1. Works for integer or real types. -
isInteger
boolean isInteger()Does the number have integer type? (Note: a rational number which is integer, e.g., "2/1", does not have integer type.)- Returns:
- true iff the number has integer type
-
isReal
boolean isReal()Does the number have real (not integer) type?- Returns:
- true iff the number is real
-