|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--prolog.implementation.Relation
The base class of a relation between some atoms, like a row in a database. This interface is used to store and get facts but also to store and get parameters e.g. in a statement
prolog: myFact(joe,dan).
in this example, the relation would contain the atoms "joe" and "dan"
| Field Summary | |
protected java.util.List |
values
the list where all atoms of the relation are stored |
| Constructor Summary | |
Relation()
costructor |
|
Relation(IRelation r)
copy constructor |
|
| Method Summary | |
void |
add(java.lang.Object value)
adds a atom to this relation |
java.util.Map |
buildMap()
builds a indexmap. a indexmap contains the atom as key and the index as integer. this function is only used for parameter matching. |
boolean |
equals(java.lang.Object o)
|
void |
genXml(java.io.Writer out,
ISymbolTable table)
generates xml describing this relation |
IAtom |
get(int index)
returns the atom at the specified index |
int |
getValueCount()
returns the number of atoms contained in this relation |
java.util.Iterator |
getValues()
returns an iterator over all atoms contained in this relation |
java.lang.String |
toString()
|
java.lang.String |
toString(int[] parameterNames,
ISymbolTable table)
returns a string representation of this object with decoded symbols in prolog syntax used for query results e.g. |
java.lang.String |
toString(ISymbolTable table)
returns a string representation of this object with decoded symbols |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected java.util.List values
| Constructor Detail |
public Relation()
public Relation(IRelation r)
r - - relation to copy| Method Detail |
public void add(java.lang.Object value)
value - - the atom to be addedpublic int getValueCount()
getValueCount in interface IRelationpublic java.util.Map buildMap()
buildMap in interface IRelationpublic IAtom get(int index)
get in interface IRelationindex - of the atom to be returnedpublic java.util.Iterator getValues()
getValues in interface IRelationpublic 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 IRelationtable - - the symboltable used to decode
public java.lang.String toString(int[] parameterNames,
ISymbolTable table)
toString in interface IRelationtable - - the symboltable used to decodeparameterNames - - the names of the parameters in this relation
public void genXml(java.io.Writer out,
ISymbolTable table)
throws java.io.IOException
genXml in interface IRelationout - the writer where o append the xmltable - the symboltable if the xml should be decodedjava.io.IOException - if writing xml fails
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||