com.timeindexing.index
Class TimeIndexDirectory

java.lang.Object
  extended bycom.timeindexing.index.TimeIndexDirectory

public class TimeIndexDirectory
extends java.lang.Object

This is the TimeIndexDirectory which returns Index objects. It provides a directory of current Indexes, which can be looked up by name or by ID. This is needed in order to shared Indexes between threads.


Field Summary
protected  java.util.HashMap countTable
          The count hashtable.
protected static TimeIndexDirectory directory
           
protected  java.util.HashMap indexByIDDirectory
          The ID directory.
protected  java.util.HashMap indexByNameDirectory
          The path directory.
 
Constructor Summary
TimeIndexDirectory()
          Construct a TimeIndexDirectory
 
Method Summary
static long addHandle(ManagedIndex index)
          Add an extra handle on an Index.
 long decrementCount(ManagedIndex index)
          Decrment the count on an Index.
static ManagedIndex find(ID anID)
          Find a Index by ID.
static ManagedIndex find(java.lang.String name)
          Find a Index by index name.
 ManagedIndex getIndex(ID anID)
          Find a Index by ID.
 ManagedIndex getIndex(java.lang.String name)
          Find a Index by index name.
 long incrementCount(ManagedIndex index)
          Incrmeent the count on an Index.
protected  boolean putIndex(ID id, ManagedIndex index)
          Save an Index by index ID
protected  boolean putIndex(java.lang.String name, ManagedIndex index)
          Save an Index by index name.
 long registerIndex(ManagedIndex index, java.lang.String name, ID anID)
          Register an Index using its name and its ID.
static long removeHandle(ManagedIndex index)
          Remove a handle on an Index.
protected  boolean removeIndex(ID id)
          Remove an Index by index ID
protected  boolean removeIndex(java.lang.String name)
          Remove an Index by index name.
 boolean unregisterIndex(ManagedIndex index)
          Unregister an Index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

directory

protected static TimeIndexDirectory directory

indexByIDDirectory

protected java.util.HashMap indexByIDDirectory
The ID directory.


indexByNameDirectory

protected java.util.HashMap indexByNameDirectory
The path directory.


countTable

protected java.util.HashMap countTable
The count hashtable.

Constructor Detail

TimeIndexDirectory

public TimeIndexDirectory()
Construct a TimeIndexDirectory

Method Detail

getIndex

public ManagedIndex getIndex(java.lang.String name)
Find a Index by index name.


putIndex

protected boolean putIndex(java.lang.String name,
                           ManagedIndex index)
Save an Index by index name.


removeIndex

protected boolean removeIndex(java.lang.String name)
Remove an Index by index name.


getIndex

public ManagedIndex getIndex(ID anID)
Find a Index by ID.


putIndex

protected boolean putIndex(ID id,
                           ManagedIndex index)
Save an Index by index ID


removeIndex

protected boolean removeIndex(ID id)
Remove an Index by index ID


registerIndex

public long registerIndex(ManagedIndex index,
                          java.lang.String name,
                          ID anID)
Register an Index using its name and its ID.


unregisterIndex

public boolean unregisterIndex(ManagedIndex index)
Unregister an Index.


incrementCount

public long incrementCount(ManagedIndex index)
Incrmeent the count on an Index.


decrementCount

public long decrementCount(ManagedIndex index)
Decrment the count on an Index.


find

public static ManagedIndex find(java.lang.String name)
Find a Index by index name.


find

public static ManagedIndex find(ID anID)
Find a Index by ID.


addHandle

public static long addHandle(ManagedIndex index)
Add an extra handle on an Index.


removeHandle

public static long removeHandle(ManagedIndex index)
Remove a handle on an Index.