|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCiaoJava.PLTerm
CiaoJava.PLInteger
Prolog integer representation.
This implementation can only work with Prolog integers
that fit in Java Integer
type. The Long
representation cannot be used due to the importance of integer
numbers for almost every class in the Java API.
Field Summary |
Fields inherited from class CiaoJava.PLTerm |
fail, nil, success |
Constructor Summary | |
PLInteger(int v)
Integer constructor. |
Method Summary | |
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. |
Methods inherited from class CiaoJava.PLTerm |
isInteger, isList, isNil, isString, isStructure, isVariable, unify |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
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.Method Detail |
public java.lang.String toString()
String
representation
of this PLInteger
object.
toString
in class PLTerm
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)
equals
in class PLTerm
t
- Prolog term to compare to.
true
if the PLTerm
received as argument is equal to this PLInteger
object.public PLTerm copy()
PLInteger
object.
Creates a new PLInteger
object with the
integer value of this object.
copy
in class PLTerm
PLInteger
with the value of this object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |