|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--prolog.implementation.Variable
This class encapsulates a variable value used in queries. Because all names in the coder's program are replaced by integers, the internal representation of a atom is a integer value. This integer value can be decoded using the symboltable generated by the parser. A value can be compared with a filled cell in a database table row
prolog: myFact(dan,X).
in this example, a atom would be "X" a variable
| Field Summary | |
protected int |
name
the interpreter internal representation of the variable. this is the index for the symboltable. |
| Constructor Summary | |
Variable(int name)
creates a new Variable |
|
| Method Summary | |
boolean |
equals(java.lang.Object o)
!!! |
int |
getName()
the key in symboltable of the name |
java.lang.String |
toString()
returns a string representation of the atom. |
java.lang.String |
toString(ISymbolTable table)
returns a string representation of the atom. because all names of the programmer's programm are replaced by integers, this function requires the additional stringtable to decode the integers into strings again. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected int name
| Constructor Detail |
public Variable(int name)
name - is the name ;-)| Method Detail |
public int getName()
getName in interface IAtompublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString(ISymbolTable table)
toString in interface IAtom
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||