|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjpl.Term
jpl.Variable
public class Variable
This class supports Java representations of Prolog variables.
A jpl.Variable instance is equivalent to a variable in a fragment of Prolog source text: it is *not* a "live" variable within a Prolog stack or heap. A corresponding Prolog variable is created only upon opening a Query whose goal refers to a Variable (and then only temporarily).
Copyright (C) 1998 Fred Dushin
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library Public License for more details.
Field Summary | |
---|---|
java.lang.String |
name
|
Constructor Summary | |
---|---|
Variable()
Create a new Variable with new sequential name of the form "_261". |
|
Variable(java.lang.String name)
Create a new Variable with 'name' (which must not be null or ""), and may one day be constrained to comply with traditional Prolog syntax. |
Method Summary | |
---|---|
Term[] |
args()
The (nonexistent) args of this Variable |
java.lang.String |
debugString()
Deprecated. |
boolean |
equals(java.lang.Object obj)
A Variable is equal to another if their names are the same and they are not anonymous. |
java.lang.String |
name()
returns the lexical name of this Variable |
java.lang.String |
toString()
Returns a Prolog source text representation of this Variable |
int |
type()
returns the type of this subclass of Term, i.e. |
java.lang.String |
typeName()
returns the typeName of this subclass of Term, i.e. |
Methods inherited from class jpl.Term |
---|
arg, arity, debugString, doubleValue, floatValue, hasFunctor, hasFunctor, hasFunctor, intValue, isAtom, isCompound, isFloat, isInteger, isJFalse, isJNull, isJObject, isJRef, isJTrue, isJVoid, isVariable, listLength, longValue, put, putParams, putParams, putTerm, toString, toTermArray |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final java.lang.String name
Constructor Detail |
---|
public Variable(java.lang.String name)
name
- the source name of this Variablepublic Variable()
Method Detail |
---|
public Term[] args()
args
in class Term
JPLException
public final java.lang.String name()
name
in class Term
public final int type()
type
in class Term
public java.lang.String typeName()
typeName
in class Term
public java.lang.String toString()
toString
in class java.lang.Object
public final boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- The Object to compare.
public java.lang.String debugString()
debugString
in class Term
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |