|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.hp.hpl.jena.graph.query.Mapping
public class Mapping
this class is used to record the mapping from [variable] Node's to the indexes they are bound to in a Query. Nodes bound to negative values are predeclared; the negative value is converted on index allocation.
Constructor Summary | |
---|---|
Mapping(Node[] preDeclare)
Create a new mapping in which all variables are unbound and the variables of preDeclare will be allocated the first slots in the map in their
natural order. |
Method Summary | |
---|---|
boolean |
hasBound(Node v)
Answer true iff we have already bound v (predeclaration doesn't count) |
int |
indexOf(Node v)
get the index of a node in the mapping; undefined if the node is not mapped. |
int |
indexOf(String name)
Answer the index of name , or throw an exception if that
name is not bound in this mapping. |
int |
lookUp(Node v)
get the index of a node in the mapping; return -1 if the node is not mapped. |
int |
newIndex(Node v)
allocate an index to the node v . |
int |
size()
Answer the number of names currently held in the map |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Mapping(Node[] preDeclare)
preDeclare
will be allocated the first slots in the map in their
natural order. [This is so that the query domain elements that come out of the
matching process will be positioned to be suitable as query answers.]
Method Detail |
---|
public int indexOf(Node v)
v
- the node to look up
public int indexOf(String name)
VariableIndexes
name
, or throw an exception if that
name is not bound in this mapping.
indexOf
in interface VariableIndexes
public int lookUp(Node v)
v
- the node to look up
public int newIndex(Node v)
v
. v
must not already be mapped.
v
- the node to be given an index
public int size()
public boolean hasBound(Node v)
v
- the node to look up
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |