public class PLInteger extends PLTerm
Integer
type. The Long
representation cannot be used due to the importance of integer
numbers for almost every class in the Java API.Constructor and Description |
---|
PLInteger(int v)
Integer constructor.
|
Modifier and Type | Method and Description |
---|---|
PLTerm |
copy()
Makes a full copy of this
PLInteger object. |
boolean |
equals(PLTerm t)
comparison between Prolog terms.
|
int |
getValue()
Gets the integer value of the
PLInteger object. |
boolean |
isRunnable()
Execution test on Prolog objects.
|
java.lang.Object |
javaRepr()
Gets the Java representation of this Prolog integer as an object.
|
java.lang.Object |
javaRepr(CiaoJava.PLInterpreter i)
Gets the Java representation of this Prolog integer as an object.
|
java.lang.String |
toString()
String representation.
|
isAtom, isFloat, isInteger, isList, isNil, isString, isStructure, isVariable, unify
public PLInteger(int v)
PLInteger
object
with initial value given as argument.v
- Initial value of this PLInteger
object.
This argument must be the largest representation of an
integral number to manage Prolog integers.public java.lang.String toString()
String
representation
of this PLInteger
object.public java.lang.Object javaRepr(CiaoJava.PLInterpreter i)
Integer
object.javaRepr
in class PLTerm
i
- PLInterpreter
object to interpret the
this Prolog term (although is not needed in this
method, this parameter is included here for compatibility with
the abstract declaration in PLTerm
).Object
representing the Prolog integer.
This object will be a Java Integer
object.public java.lang.Object javaRepr()
Integer
object.Object
representing the Prolog integer.
This object will be a Java Integer
object.public int getValue()
PLInteger
object.int
value of this Prolog integer.public boolean isRunnable()
PLTerm
class.isRunnable
in class PLTerm
false
.public boolean equals(PLTerm t)