com.hp.hpl.jena.graph.query
Class Mapping

java.lang.Object
  extended bycom.hp.hpl.jena.graph.query.Mapping

public class Mapping
extends java.lang.Object

this class is used to record the mapping from [variable] Node's to the indexes they are bound to in a Query.


Constructor Summary
Mapping()
          create a new, empty mapping.
 
Method Summary
 int indexOf(Node v)
          get the index of a node in the mapping; undefined if the node is not mapped.
 boolean maps(Node v)
           
 int newIndex(Node v)
          allocate an index to the node _v_.
 int size()
          Answer the number of names currently held in the map
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Mapping

public Mapping()
create a new, empty mapping.

Method Detail

indexOf

public int indexOf(Node v)
get the index of a node in the mapping; undefined if the node is not mapped.

Parameters:
v - the node to look up
Returns:
the index of v in the mapping

newIndex

public int newIndex(Node v)
allocate an index to the node _v_. _v_ must not already be mapped.

Parameters:
v - the node to be given an index
Returns:
the value of the allocated index

size

public int size()
Answer the number of names currently held in the map

Returns:
the number of names in the map

maps

public boolean maps(Node v)
Parameters:
v - the node to look up
Returns:
true iff this mapping maps _v_ to an index

toString

public java.lang.String toString()
Returns:
a string representing this mapping


Copyright © 2001-2003 Hewlett-Packard. All Rights Reserved.