|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCiaoJava.PLTerm
CiaoJava.PLString
This class implements the Java representation of a Prolog string. Although in Prolog strings are represented as lists of integers, internally a more eficient implementation is made. The Java side of this interface has implemented the string representation accordingly to the byte representation given by the serialization mechanism.
Field Summary |
Fields inherited from class CiaoJava.PLTerm |
fail, nil, success |
Constructor Summary | |
PLString(java.lang.String s)
Given a Java string, creates a Java PLString
object. |
Method Summary | |
PLTerm |
copy()
Makes a full copy of this PLString
object. |
boolean |
equals(PLTerm t)
Compares this PLString object with the PLTerm given as
argument. |
java.lang.String |
getValue()
Gets the value of a Prolog string object. |
boolean |
isRunnable()
Execution test on Prolog objects. |
java.lang.Object |
javaRepr()
Java representation of a PLString . |
java.lang.Object |
javaRepr(CiaoJava.PLInterpreter i)
Java representation of a PLString . |
int |
length()
Returns the number of characters of this PLString . |
PLList |
toPLList()
Converts this Prolog string into a Prolog list of ASCII codes of this string. |
java.lang.String |
toString()
String representation of a Java PLString object. |
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 PLString(java.lang.String s)
PLString
object.
s
- String that will contain the Prolog string.Method Detail |
public java.lang.String toString()
toString
in class PLTerm
public java.lang.String getValue()
public java.lang.Object javaRepr(CiaoJava.PLInterpreter i)
PLString
. Creates a copy
of the value of this PLString
and returns it.
javaRepr
in class PLTerm
i
- PLInterpreter
object used to
obtain the Java representation. Included
here only for compatibility purposes.
public java.lang.Object javaRepr()
PLString
. Creates a copy
of the value of this PLString
and returns it.
public boolean isRunnable()
isRunnable
in class PLTerm
false
.public boolean equals(PLTerm t)
PLString
object with the PLTerm
given as
argument. Implementation of the method inherited from PLTerm.
equals
in class PLTerm
t
- Prolog term to be compared to.
true
if this Prolog string is equal
to the term received as argument;
false
otherwise.public PLTerm copy()
PLString
object.
copy
in class PLTerm
public int length()
PLString
.
public PLList toPLList() throws PLException
PLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |