org.basex.query.util
Class ItemValueMap

java.lang.Object
  extended by org.basex.util.hash.ASet
      extended by org.basex.query.util.HashItemSet
          extended by org.basex.query.util.ItemValueMap
All Implemented Interfaces:
java.lang.Iterable<Item>, ItemSet

public class ItemValueMap
extends HashItemSet

Map for quickly indexing items.

Author:
BaseX Team 2005-12, BSD License, Christian Gruen

Field Summary
 
Fields inherited from class org.basex.util.hash.ASet
bucket, next, size
 
Constructor Summary
ItemValueMap()
           
 
Method Summary
 void add(Item key, Value value, InputInfo ii)
          Indexes the specified key and stores the associated value.
 Value get(Item key, InputInfo ii)
          Returns the value for the specified key.
protected  void rehash(int s)
          Rehashes all entries.
 java.lang.Iterable<Value> values()
          Returns a value iterator.
 
Methods inherited from class org.basex.query.util.HashItemSet
add, hash, id, iterator, put
 
Methods inherited from class org.basex.util.hash.ASet
checkSize, clear, isEmpty, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ItemValueMap

public ItemValueMap()
Method Detail

add

public void add(Item key,
                Value value,
                InputInfo ii)
         throws QueryException
Indexes the specified key and stores the associated value. If the key already exists, the value is updated.

Parameters:
key - key
value - value
ii - input info
Throws:
QueryException - query exception

get

public Value get(Item key,
                 InputInfo ii)
          throws QueryException
Returns the value for the specified key.

Parameters:
key - key to be found
ii - input info
Returns:
value or null if nothing was found
Throws:
QueryException - query exception

values

public final java.lang.Iterable<Value> values()
Returns a value iterator.

Returns:
iterator

rehash

protected void rehash(int s)
Description copied from class: ASet
Rehashes all entries.

Overrides:
rehash in class HashItemSet
Parameters:
s - new hash size