|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--prolog.implementation.Value
This class encapsulates a constant value, one item of a relation. 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 "dan" a value
| Field Summary | |
protected int |
value
the interpreter internal representation of the constant. this is the index for the symboltable |
| Constructor Summary | |
Value(int value)
creates a new Value |
|
| Method Summary | |
boolean |
equals(java.lang.Object o)
overrides equals in java.lang.Object. if the given Object o is of the same class, the compare action is done, if not, it returns false |
int |
getName()
the key in symboltable of the name |
int |
hashCode()
returns a hashcode ;-) WOW ;-) |
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 value
| Constructor Detail |
public Value(int value)
value - is the name used by the programer| Method Detail |
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int getName()
getName in interface IAtompublic java.lang.String toString(ISymbolTable table)
toString in interface IAtompublic java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||