org.apache.jackrabbit.core.persistence.bundle.util
Class NamespaceIndex

java.lang.Object
  extended by org.apache.jackrabbit.core.persistence.bundle.util.NamespaceIndex
All Implemented Interfaces:
StringIndex

public class NamespaceIndex
extends Object
implements StringIndex

Implements a string index that is based on the namespace indexes of the namespace registry.


Constructor Summary
NamespaceIndex(NamespaceRegistryImpl nsReg)
          Creates a new index that uses the given namespace registry.
 
Method Summary
 String indexToString(int idx)
          Returns the string for a given index.
 int stringToIndex(String uri)
          Returns the index for a given string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamespaceIndex

public NamespaceIndex(NamespaceRegistryImpl nsReg)
Creates a new index that uses the given namespace registry.

Parameters:
nsReg - the namespace registry
Method Detail

stringToIndex

public int stringToIndex(String uri)
Returns the index for a given string. if the string does not exist in the underlying index map a new index needs to be created.

Specified by:
stringToIndex in interface StringIndex
Parameters:
uri - the string to return the index for
Returns:
the index of that string.

indexToString

public String indexToString(int idx)
Returns the string for a given index. if the index does not exist in the underlying index map, null is returned.

Specified by:
indexToString in interface StringIndex
Parameters:
idx - the index tp returns the string for.
Returns:
the string or null


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.