Servertec
Persistent Object Store
1.4.1 09/04/2005

stec.pos
Class IndexedObjectStoreReference

java.lang.Object
  extended by stec.pos.IndexedObjectStoreReference
All Implemented Interfaces:
Iterator

public final class IndexedObjectStoreReference
extends java.lang.Object
implements Iterator

Handle to the indexed persistent object store returned by IndexedObjectStore.open() used to interface with the opened indexed persistent object store.

Uses the default index when performing operations.

Since:
1.1.0 09/01/2002
See Also:
open

Method Summary
 boolean ascending()
          Returns whether the default index is sorted in ascending order.
 boolean atFirst()
          Returns whether the key, value pair cursor is at the first key, value pair.
 boolean atLast()
          Returns whether the key, value pair cursor is at the last key, value pair.
 void clear()
          Removes all the keys and associated values from the indexed persistent object store.
 void close()
          Closes this handle to the indexed persistent object store.
 boolean contains(java.lang.Object key, java.lang.Object value)
          Returns whether the indexed persistent object store contains the specified key, value pair.
 boolean containsID(java.lang.Object key, java.lang.Object object_store_key)
          Returns whether the indexed persistent object store contains the specified key associated with the given object store key.
 boolean containsIndex(java.lang.String name)
          Returns whether the IndexedObjectStore contains the specified index.
 boolean containsKey(java.lang.Object key)
          Returns whether the indexed persistent object store contains the specified key associated with any value.
 boolean containsValue(java.lang.Object value)
          Returns whether the indexed persistent object store contains the specified object associated with any key.
 boolean duplicates()
          Returns whether the default index supports duplicates.
 boolean first()
          Attempt to set the cursor to the first key, value pair.
 java.lang.Object get(java.lang.Object key)
          Returns the object associated with the specified key from the indexed persistent object store.
 java.lang.Object get(java.lang.Object key, java.lang.Object id)
          Returns the object associated with the specified key, id from the indexed persistent object store.
 java.lang.Object getCurrentKey()
          Returns the current key or null if none exists.
 java.lang.Object getCurrentValue()
          Returns the current value or null if none exists.
 java.lang.String getDefaultIndex()
          Returns the name of the default index.
 java.lang.String getFilename()
          Returns the filename of the store this reference references.
 java.lang.Object getID()
          Returns the persistent object store key associated with the current index cursor.
 java.lang.String getKeysClassName()
          Returns the keys class name for the default index.
 java.lang.String getKeysIndexCollator()
          Returns the class name of the keys index collator for the default index.
 java.lang.String getValuesClassName()
          Returns the values class name for the default index.
 java.lang.String getValuesIndexCollator()
          Returns the class name of the values index collator for the default index.
 boolean iLocked(java.lang.Object key)
          Returns whether the current IndexedObjectStoreReference has locked the specified key.
 boolean iReadLocked(java.lang.Object key)
          Returns whether the current IndexedObjectStoreReference has read locked the specified key.
 boolean isEmpty()
          Returns whether the indexed persistent object store is empty.
 boolean isLocked(java.lang.Object key)
          Returns whether the specified key is locked.
 boolean isOpen()
          Returns whether the current IndexedObjectStoreReference is still open.
 boolean isReadLocked(java.lang.Object key)
          Returns whether the specified key is read locked.
 boolean isSet()
          Returns whether the key, value pair cursor is set to a key, value pair.
 boolean isWriteLocked(java.lang.Object key)
          Returns whether the specified key is write locked.
 boolean iWriteLocked(java.lang.Object key)
          Returns whether the current IndexedObjectStoreReference has write locked the specified key.
 boolean last()
          Attempt to set the cursor to the last key, value pair.
 void lock(java.lang.Object key)
          Write locks the specified key or waits until it can be write locked.
 boolean lock(java.lang.Object key, long timeout)
          Write locks the specified key or waits until it can be write locked or the specified timeout is reached.
 int lockCount()
          Returns the number of locked keys.
 int lockCount(java.lang.Object key)
          Returns the number of locks for the specified key.
 java.util.Enumeration locks()
          Returns an Enumeration of the locked keys.
 java.util.Enumeration locks(java.lang.Object key)
          Returns an Enumeration of the locks on the specified key.
 boolean next()
          Fowards the cursor and returns whether a next key, value pair exists.
 boolean next(IndexFilter filter)
          Forwards the cursor and returns whether a next key, value pair exists that meets the specified criteria.
 java.lang.Object nextKey()
          Returns the next key.
 java.lang.Object nextKey(IndexFilter filter)
          Returns the next key that meets the specified criteria.
 java.lang.Object nextValue()
          Returns the next value.
 java.lang.Object nextValue(boolean all_keys)
          Returns the next value.
 java.lang.Object nextValue(IndexFilter filter)
          Returns the next value that meets the specified criteria.
 java.lang.Object nextValue(IndexFilter filter, boolean all_keys)
          Returns the next value that meets the specified criteria.
 boolean previous()
          Moves the cursor back and returns whether a prior key, value pair exists.
 boolean previous(IndexFilter filter)
          Moves the cursor back and returns whether a prior key, value pair exists that meets the specified criteria.
 java.lang.Object previousKey()
          Returns the previous key.
 java.lang.Object previousKey(IndexFilter filter)
          Returns the previous key that meets the specified criteria.
 java.lang.Object previousValue()
          Returns the previous value.
 java.lang.Object previousValue(boolean all_keys)
          Returns the previous value.
 java.lang.Object previousValue(IndexFilter filter)
          Returns the previous value that meets the specified criteria.
 java.lang.Object previousValue(IndexFilter filter, boolean all_keys)
          Returns the previous value that meets the specified criteria.
 void put(java.lang.Object key, java.lang.Object value)
          Stores the specified object associated with the given key object in the indexed persistent object store.
 void readLock(java.lang.Object key)
          Read locks the specified key or waits until it can be read locked.
 boolean readLock(java.lang.Object key, long timeout)
          Read locks the specified key or waits until it can be read locked or the specified timeout is reached.
 void remove()
          Removes the current key, value pair from the indexed persistent object store.
 void remove(java.lang.Object key)
          Removes the specified key and associated value from the indexed persistent object store.
 void remove(java.lang.Object key, java.lang.Object id)
          Removes the specific key, id from the indexed persistent object store.
 boolean seek(java.lang.Object key)
          Sets the current cursor to the specified key.
 boolean seek(java.lang.Object key, java.lang.Object id)
          Sets the current cursor to the specified key, value pair.
 boolean setCurrentKey(java.lang.Object key)
          Sets the current key to the specified existing key.
 boolean setCurrentValue(java.lang.Object value)
          Sets the current value cursor to the specified existing value.
 boolean setCursor(java.lang.Object key, java.lang.Object id)
          Sets the current cursor to the specified existing key, id.
 void setDefaultIndex(java.lang.String name)
          Sets the default index.
 int size()
          Returns the number of key, value pairs in the indexed persistent object store.
 void unlock(java.lang.Object key)
          Unlocks the specified key.
 void unlockAll()
          Clears all the locks to this indexed persistent object store.
 void unlockMine()
          Clears all the locks for the current IndexedObjectStoreReference.
 int valueCount(java.lang.Object key)
          Returns the number of duplicate values associated with the specified key in the indexed persistent object store.
 void writeLock(java.lang.Object key)
          Write locks the specified key or waits until it can be write locked.
 boolean writeLock(java.lang.Object key, long timeout)
          Write locks the specified key or waits until it can be write locked or the specified timeout is reached.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

close

public final void close()
                 throws java.io.IOException
Closes this handle to the indexed persistent object store.

Also closes handles to associated object store and indexes.

Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
open

get

public final java.lang.Object get(java.lang.Object key)
                           throws java.io.IOException
Returns the object associated with the specified key from the indexed persistent object store.

Uses the specified index key to retrieve the object store key from the default index. Then uses the object store key to retrieve the associated value from the object store. If the index key is not associated with any object store key then null is returned.

Changes the key, value pair cursor if the specified key was found.

Unlike java.util.Hashtable.get(), null is a valid return value and cannot be used to determine whether a value was associated with the specified key, instead stec.pos.IndexedObjectStoreReference.containsKey(Object) should be used.

Parameters:
key - the key to use. key cannot be null.
Returns:
any value associated with the specified key. If not found returns null.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
put, remove, remove, remove, containsKey, containsValue, contains

get

public final java.lang.Object get(java.lang.Object key,
                                  java.lang.Object id)
                           throws java.io.IOException
Returns the object associated with the specified key, id from the indexed persistent object store.

If the specified index key, id exists in the default index then the specified id is used to retrieve the associated value from the object store. If the specified index key, id does not exist in the default index then null is returned.

Changes the key, value pair cursor if the specified key, id was found.

Unlike java.util.Hashtable.get(), null is a valid return value and cannot be used to determine whether a value was associated with the specified key, id, instead stec.pos.IndexedObjectStoreReference.containsKey(Object) should be used.

Parameters:
key - the key to use. key cannot be null.
id - the id to use. id can not be null.
Returns:
any value associated with the specified key, id. If not found returns null.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
put, remove, remove, remove, containsKey, containsValue, contains

getID

public final java.lang.Object getID()
                             throws java.io.IOException
Returns the persistent object store key associated with the current index cursor.

Uses the value cursor.

Returns:
any value associated with the specified key.
Throws:
java.io.IOException - if an I/O exception occurred.

put

public final void put(java.lang.Object key,
                      java.lang.Object value)
               throws java.io.IOException
Stores the specified object associated with the given key object in the indexed persistent object store.

Uses the specified key, value pair to update associated object store and indexes.

Invalidates the key, value pair cursor if the specified key exists.

Unlike java.util.Hashtable.put(), null is a valid value and this method does not return any value previously associated with the specified key.

Parameters:
key - the key to store. key cannot be null.
value - the value to associate with the specified key.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
get, remove, remove, remove

remove

public final void remove(java.lang.Object key)
                  throws java.io.IOException
Removes the specified key and associated value from the indexed persistent object store.

Uses the specified index key to retrieve the object store key from the default index. Then uses the object store key to retrieve the associated value. Finally uses the object store key, value pair to remove the key, value pair from the associated object store and indexes.

Uses the key, value pair cursor and invalidates the key, value pair cursor.

Unlike java.util.Hashtable.remove(), this method does not return any value previously associated with the specified key.

Parameters:
key - the key to remove. key cannot be null.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
get, put, remove, remove

remove

public final void remove(java.lang.Object key,
                         java.lang.Object id)
                  throws java.io.IOException
Removes the specific key, id from the indexed persistent object store.

If the specified index key, id exists in the default index then the specified id is used to retrieve the associated value from the object store. Finally uses the specified id, value pair to remove the key, value pair from the associated object store and indexes.

Uses the key, value pair cursor and invalidates the key, value pair cursor.

Parameters:
key - the key to remove. key cannot be null.
id - the id to remove. id can not be null.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
remove, remove

remove

public final void remove()
                  throws java.io.IOException
Removes the current key, value pair from the indexed persistent object store.

Uses the key, value pair cursor and invalidates the key, value pair cursor.

Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
remove, remove

containsKey

public final boolean containsKey(java.lang.Object key)
                          throws java.io.IOException
Returns whether the indexed persistent object store contains the specified key associated with any value.

Parameters:
key - the key to test.
Returns:
whether the indexed persistent object store contains the specified key associated with any value.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
containsValue, contains

containsValue

public final boolean containsValue(java.lang.Object value)
                            throws java.io.IOException
Returns whether the indexed persistent object store contains the specified object associated with any key.

Searching for a value in a large indexed persistent object store may take a long time.

Parameters:
value - the value to test.
Returns:
whether the indexed persistent object store contains the specified object associated with any key.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
containsKey, contains

contains

public final boolean contains(java.lang.Object key,
                              java.lang.Object value)
                       throws java.io.IOException
Returns whether the indexed persistent object store contains the specified key, value pair.

Searching for a value in a large indexed persistent object store may take a long time.

Parameters:
key - the key to test.
value - the value to test.
Returns:
whether the indexed persistent object store contains the specified object key, value pair.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
containsKey, containsValue

containsID

public final boolean containsID(java.lang.Object key,
                                java.lang.Object object_store_key)
                         throws java.io.IOException
Returns whether the indexed persistent object store contains the specified key associated with the given object store key.

Parameters:
key - the key to test.
object_store_key - the value to test.
Returns:
whether the indexed persistent object store contains the specified key associated with the given object store key.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
contains, containsKey, containsValue

size

public final int size()
               throws java.io.IOException
Returns the number of key, value pairs in the indexed persistent object store.

Returns:
the number of key, value pairs in the indexed persistent object store.
Throws:
java.io.IOException - if an I/O exception occurred.

isEmpty

public final boolean isEmpty()
                      throws java.io.IOException
Returns whether the indexed persistent object store is empty.

Specified by:
isEmpty in interface Iterator
Returns:
whether the indexed persistent object store was empty.
Throws:
java.io.IOException - if an I/O exception occurred.

valueCount

public final int valueCount(java.lang.Object key)
                     throws java.io.IOException
Returns the number of duplicate values associated with the specified key in the indexed persistent object store.

Specified by:
valueCount in interface Iterator
Parameters:
key - the key whose values will be counted.
Returns:
the number of duplicate values associated with the specified key in the indexed persistent object store.
Throws:
java.io.IOException - if an I/O exception occurred.

clear

public final void clear()
                 throws java.io.IOException
Removes all the keys and associated values from the indexed persistent object store.

Also removes all locks and clears associated object store and indexes.

Throws:
java.io.IOException - if an I/O exception occurred.

lock

public final void lock(java.lang.Object key)
                throws java.io.IOException
Write locks the specified key or waits until it can be write locked.

Same as writeLock().

If the key is already read or write locked by another stec.pos.IndexedObjectStoreReference the current thread will be blocked until the specified key can be write locked.

Once a key is locked it remains locked until the key is explicitly unlocked by a call to stec.pos.IndexedObjectStoreReference.unlock(Object), the indexed persistent object store is cleared by a call to stec.pos.IndexedObjectStoreReference.clear() or the stec.pos.IndexedObjectStoreReference is closed.

Parameters:
key - the key to write lock. key cannot be null.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
readLock, writeLock, lock, readLock, writeLock, unlock, unlockAll, unlockMine

readLock

public final void readLock(java.lang.Object key)
                    throws java.io.IOException
Read locks the specified key or waits until it can be read locked.

If the key is already write locked by another stec.pos.IndexedObjectStoreReference the current thread will be blocked until the specified key can be read locked.

Once a key is locked it remains locked until the key is explicitly unlocked by a call to stec.pos.IndexedObjectStoreReference.unlock(Object), the indexed persistent object store is cleared by a call to stec.pos.IndexedObjectStoreReference.clear() or the stec.pos.IndexedObjectStoreReference is closed.

Parameters:
key - the key to read lock. key cannot be null.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.4.0 08/23/2004
See Also:
lock, writeLock, lock, readLock, writeLock, unlock, unlockAll, unlockMine

writeLock

public final void writeLock(java.lang.Object key)
                     throws java.io.IOException
Write locks the specified key or waits until it can be write locked.

If the key is already read or write locked by another stec.pos.IndexedObjectStoreReference the current thread will be blocked until the specified key can be write locked.

Once a key is locked it remains locked until the key is explicitly unlocked by a call to stec.pos.IndexedObjectStoreReference.unlock(Object), the indexed persistent object store is cleared by a call to stec.pos.IndexedObjectStoreReference.clear() or the stec.pos.IndexedObjectStoreReference is closed.

Parameters:
key - the key to write lock. key cannot be null.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.4.0 08/23/2004
See Also:
lock, readLock, lock, readLock, writeLock, unlock, unlockAll, unlockMine

lock

public final boolean lock(java.lang.Object key,
                          long timeout)
                   throws java.io.IOException
Write locks the specified key or waits until it can be write locked or the specified timeout is reached.

Same as writeLock().

If the key is already read or write locked by another stec.pos.IndexedObjectStoreReference the current thread will be blocked until the key can be write locked or the specified timeout is reached.

Once a key is locked it remains locked until the key is explicitly unlocked by a call to stec.pos.IndexedObjectStoreReference.unlock(Object), the indexed persistent object store is cleared by a call to stec.pos.IndexedObjectStoreReference.clear() or the stec.pos.IndexedObjectStoreReference is closed.

Parameters:
key - the key to write lock. key cannot be null.
timeout - the number of milliseconds to wait. -1 for unlimited.
Returns:
whether or not the specified key could be write locked.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
lock, readLock, writeLock, readLock, writeLock, unlock, unlockAll, unlockMine

readLock

public final boolean readLock(java.lang.Object key,
                              long timeout)
                       throws java.io.IOException
Read locks the specified key or waits until it can be read locked or the specified timeout is reached.

If the key is already write locked by another stec.pos.IndexedObjectStoreReference the current thread will be blocked until the key can be read locked or the specified timeout is reached.

Once a key is locked it remains locked until the key is explicitly unlocked by a call to stec.pos.IndexedObjectStoreReference.unlock(Object), the indexed persistent object store is cleared by a call to stec.pos.IndexedObjectStoreReference.clear() or the stec.pos.IndexedObjectStoreReference is closed.

Parameters:
key - the key to read lock. key cannot be null.
timeout - the number of milliseconds to wait. -1 for unlimited.
Returns:
whether or not the specified key could be read locked.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.4.0 08/23/2004
See Also:
lock, readLock, writeLock, lock, writeLock, unlock, unlockAll, unlockMine

writeLock

public final boolean writeLock(java.lang.Object key,
                               long timeout)
                        throws java.io.IOException
Write locks the specified key or waits until it can be write locked or the specified timeout is reached.

If the key is already read or write locked by another stec.pos.IndexedObjectStoreReference the current thread will be blocked until the key can be write locked or the specified timeout is reached.

Once a key is locked it remains locked until the key is explicitly unlocked by a call to stec.pos.IndexedObjectStoreReference.unlock(Object), the indexed persistent object store is cleared by a call to stec.pos.IndexedObjectStoreReference.clear() or the stec.pos.IndexedObjectStoreReference is closed.

Parameters:
key - the key to write lock. key cannot be null.
timeout - the number of milliseconds to wait. -1 for unlimited.
Returns:
whether or not the specified key could be write locked.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.4.0 08/23/2004
See Also:
lock, readLock, writeLock, lock, readLock, unlock, unlockAll, unlockMine

unlock

public final void unlock(java.lang.Object key)
                  throws java.io.IOException
Unlocks the specified key.

Parameters:
key - the key to unlock. key cannot be null.
Throws:
java.io.IOException - if the specified key is locked by another stec.pos.IndexedObjectStoreReference or if an I/O exception occurred.
See Also:
lock, readLock, writeLock, lock, readLock, writeLock, unlockAll, unlockMine

unlockAll

public final void unlockAll()
                     throws java.io.IOException
Clears all the locks to this indexed persistent object store.

Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
lock, readLock, writeLock, lock, readLock, writeLock, unlock, unlockMine

unlockMine

public final void unlockMine()
                      throws java.io.IOException
Clears all the locks for the current IndexedObjectStoreReference.

Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
lock, readLock, writeLock, lock, readLock, writeLock, unlock, unlockAll

isLocked

public final boolean isLocked(java.lang.Object key)
                       throws java.io.IOException
Returns whether the specified key is locked.

Parameters:
key - the key to test. key cannot be null.
Returns:
whether the specified key is locked.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
isReadLocked, isWriteLocked, iLocked, iReadLocked, iWriteLocked

isReadLocked

public final boolean isReadLocked(java.lang.Object key)
                           throws java.io.IOException
Returns whether the specified key is read locked.

Parameters:
key - the key to test. key cannot be null.
Returns:
whether the specified key is read locked.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.4.0 08/23/2004
See Also:
isLocked, isWriteLocked, iLocked, iReadLocked, iWriteLocked

isWriteLocked

public final boolean isWriteLocked(java.lang.Object key)
                            throws java.io.IOException
Returns whether the specified key is write locked.

Parameters:
key - the key to test. key cannot be null.
Returns:
whether the specified key is write locked.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.4.0 08/23/2004
See Also:
isLocked, isReadLocked, iLocked, iReadLocked, iWriteLocked

iLocked

public final boolean iLocked(java.lang.Object key)
                      throws java.io.IOException
Returns whether the current IndexedObjectStoreReference has locked the specified key.

Parameters:
key - the key to test. key cannot be null.
Returns:
whether the specified key is locked by the current IndexedObjectStoreReference.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
isLocked, isReadLocked, isWriteLocked, iReadLocked, iWriteLocked

iReadLocked

public final boolean iReadLocked(java.lang.Object key)
                          throws java.io.IOException
Returns whether the current IndexedObjectStoreReference has read locked the specified key.

Parameters:
key - the key to test. key cannot be null.
Returns:
whether the specified key is read locked by the current IndexedObjectStoreReference.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.4.0 08/23/2004
See Also:
isLocked, isReadLocked, isWriteLocked, iLocked, iWriteLocked

iWriteLocked

public final boolean iWriteLocked(java.lang.Object key)
                           throws java.io.IOException
Returns whether the current IndexedObjectStoreReference has write locked the specified key.

Parameters:
key - the key to test. key cannot be null.
Returns:
whether the specified key is write locked by the current IndexedObjectStoreReference.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.4.0 08/23/2004
See Also:
isLocked, isReadLocked, isWriteLocked, iLocked, iReadLocked

lockCount

public int lockCount()
              throws java.io.IOException
Returns the number of locked keys.

Returns:
the number of locked keys.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.2.0 12/03/2002
See Also:
lockCount

lockCount

public int lockCount(java.lang.Object key)
              throws java.io.IOException
Returns the number of locks for the specified key.

Parameters:
key - the key check to use.
Returns:
the number of locks for the specified key.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.4.0 08/23/2004
See Also:
lockCount

locks

public java.util.Enumeration locks()
                            throws java.io.IOException
Returns an Enumeration of the locked keys.

Returns:
the Enumeration of the locked keys.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.4.0 08/23/2004
See Also:
locks, Enumeration, LinkedList

locks

public java.util.Enumeration locks(java.lang.Object key)
                            throws java.io.IOException
Returns an Enumeration of the locks on the specified key.

Parameters:
key - the object to use.
Returns:
the Enumeration of of the locks.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.4.0 08/23/2004
See Also:
locks, Enumeration, Lock

isOpen

public final boolean isOpen()
                     throws java.io.IOException
Returns whether the current IndexedObjectStoreReference is still open.

Checks associated object store and indexes.

Specified by:
isOpen in interface Iterator
Returns:
whether the current IndexedObjectStoreReference is open.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
open, close

containsIndex

public final boolean containsIndex(java.lang.String name)
                            throws java.io.IOException
Returns whether the IndexedObjectStore contains the specified index.

Parameters:
name - the name of the index.
Returns:
whether the IndexedObjectStore contains the specified index.
Throws:
java.io.IOException - if an I/O exception occurred.

getDefaultIndex

public final java.lang.String getDefaultIndex()
                                       throws java.io.IOException
Returns the name of the default index.

Returns:
the name of the default index.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
setDefaultIndex

setDefaultIndex

public final void setDefaultIndex(java.lang.String name)
                           throws java.lang.IllegalArgumentException,
                                  java.io.IOException
Sets the default index.

Parameters:
name - the name of the new default index.
Throws:
java.lang.IllegalArgumentException - if the named index could not be found.
java.io.IOException - if an I/O exception occurred.
See Also:
getDefaultIndex

setCursor

public final boolean setCursor(java.lang.Object key,
                               java.lang.Object id)
                        throws java.io.IOException
Sets the current cursor to the specified existing key, id.

Changes the key, value pair cursor if the specified key, id was found.

Specified by:
setCursor in interface Iterator
Parameters:
key - the key to set as the current key.
id - the id to set as the current value.
Returns:
whether the specified key, id exists and if the current key, value pair could be set to the specified key, id.
Throws:
java.io.IOException - if an I/O exception occurred.

getCurrentKey

public final java.lang.Object getCurrentKey()
                                     throws java.io.IOException
Returns the current key or null if none exists.

Uses the key cursor.

Specified by:
getCurrentKey in interface Iterator
Returns:
the current key. null if none.
Throws:
java.io.IOException - if an I/O exception occurred.

getCurrentValue

public final java.lang.Object getCurrentValue()
                                       throws java.io.IOException
Returns the current value or null if none exists.

Uses the value cursor.

Specified by:
getCurrentValue in interface Iterator
Returns:
the current value. null if none.
Throws:
java.io.IOException - if an I/O exception occurred.

setCurrentKey

public final boolean setCurrentKey(java.lang.Object key)
                            throws java.io.IOException
Sets the current key to the specified existing key.

Changes the key, value pair cursor if the specified key was found.

Specified by:
setCurrentKey in interface Iterator
Parameters:
key - the key to set as the current key.
Returns:
whether the specified key exists and if the current key could be set to the specified key.
Throws:
java.io.IOException - if an I/O exception occurred.

setCurrentValue

public final boolean setCurrentValue(java.lang.Object value)
                              throws java.io.IOException
Sets the current value cursor to the specified existing value.

Changes the value cursor if the specified value was found.

Specified by:
setCurrentValue in interface Iterator
Parameters:
value - the value to set as the current value.
Returns:
whether the current key is associated with the specified value and if the current value cursor could be set to the specified value.
Throws:
java.io.IOException - if an I/O exception occurred.

first

public final boolean first()
                    throws java.io.IOException
Attempt to set the cursor to the first key, value pair.

Changes the key, value pair cursor.

Specified by:
first in interface Iterator
Returns:
whether the cursor could be set to the first key, value pair. Returns false if the IndexedObjectStore was empty.
Throws:
java.io.IOException - if an I/O exception occurred.

last

public final boolean last()
                   throws java.io.IOException
Attempt to set the cursor to the last key, value pair.

Changes the key, value pair cursor.

Specified by:
last in interface Iterator
Returns:
whether the cursor could be set to the last key. Returns false if the IndexedObjectStore was empty.
Throws:
java.io.IOException - if an I/O exception occurred.

atFirst

public final boolean atFirst()
                      throws java.io.IOException
Returns whether the key, value pair cursor is at the first key, value pair.

Uses the key, value pair cursor.

Specified by:
atFirst in interface Iterator
Returns:
whether the key, value pair cursor was at the first key, value pair. Returns false if the IndexedObjectStore was empty.
Throws:
java.io.IOException - if an I/O exception occurred.

atLast

public final boolean atLast()
                     throws java.io.IOException
Returns whether the key, value pair cursor is at the last key, value pair.

Uses the key, value pair cursor.

Specified by:
atLast in interface Iterator
Returns:
whether the key, value pair cursor was at the last key, value pair. Returns false if the IndexedObjectStore was empty.
Throws:
java.io.IOException - if an I/O exception occurred.

isSet

public final boolean isSet()
                    throws java.io.IOException
Returns whether the key, value pair cursor is set to a key, value pair.

Uses the key, value pair cursor.

Specified by:
isSet in interface Iterator
Returns:
whether the key, value pair cursor was set to a key, value pair.
Throws:
java.io.IOException - if an I/O exception occurred.

previous

public final boolean previous()
                       throws java.io.IOException
Moves the cursor back and returns whether a prior key, value pair exists.

Uses and updates the key, value pair cursor.

If a previous key exists then this method sets the current value to the last value of the new key.

Specified by:
previous in interface Iterator
Returns:
whether a prior key, value pair exists.
Throws:
java.io.IOException - if an I/O exception occurred.

previous

public final boolean previous(IndexFilter filter)
                       throws java.io.IOException
Moves the cursor back and returns whether a prior key, value pair exists that meets the specified criteria.

Uses and updates the key, value pair cursor.

If a previous key exists then this method sets the current value to the last value of the new key.

Specified by:
previous in interface Iterator
Parameters:
filter - the IndexFilter that evaluates whether key, value pairs match the criteria.
Returns:
whether a prior key, value pair exists that meets the specified criteria.
Throws:
java.io.IOException - if an I/O exception occurred.

previousKey

public final java.lang.Object previousKey()
                                   throws java.io.IOException
Returns the previous key.

Uses and updates the key, value pair cursor.

If a previous key exists then this method sets the current value to the last value of the new key.

Specified by:
previousKey in interface Iterator
Returns:
the previous key. null if none exists.
Throws:
java.io.IOException - if an I/O exception occurred.

previousKey

public final java.lang.Object previousKey(IndexFilter filter)
                                   throws java.io.IOException
Returns the previous key that meets the specified criteria.

Uses and updates the key, value pair cursor.

If a previous key exists then this method sets the current value to the last value of the new key.

Specified by:
previousKey in interface Iterator
Parameters:
filter - the IndexFilter that evaluates whether key, value pairs match the criteria.
Returns:
the previous key. null if none exists.
Throws:
java.io.IOException - if an I/O exception occurred.

previousValue

public final java.lang.Object previousValue()
                                     throws java.io.IOException
Returns the previous value.

Uses and updates the key, value pair cursor.

Specified by:
previousValue in interface Iterator
Returns:
the previous value. null if none exists.
Throws:
java.io.IOException - if an I/O exception occurred.

previousValue

public final java.lang.Object previousValue(boolean all_keys)
                                     throws java.io.IOException
Returns the previous value.

Uses and updates the key, value pair cursor.

Specified by:
previousValue in interface Iterator
Parameters:
all_keys - whether to return the previous value for all keys or for only the current key.
Returns:
the previous value. null if none exists.
Throws:
java.io.IOException - if an I/O exception occurred.

previousValue

public final java.lang.Object previousValue(IndexFilter filter)
                                     throws java.io.IOException
Returns the previous value that meets the specified criteria.

Uses and updates the key, value pair cursor.

Specified by:
previousValue in interface Iterator
Parameters:
filter - the IndexFilter that evaluates whether key, value pairs match the criteria.
Returns:
the previous value. null if none exists.
Throws:
java.io.IOException - if an I/O exception occurred.

previousValue

public final java.lang.Object previousValue(IndexFilter filter,
                                            boolean all_keys)
                                     throws java.io.IOException
Returns the previous value that meets the specified criteria.

Uses and updates the key, value pair cursor.

Specified by:
previousValue in interface Iterator
Parameters:
filter - the IndexFilter that evaluates whether key, value pairs match the criteria.
all_keys - whether to return the previous value for all keys or for only the current key.
Returns:
the previous value. null if none exists.
Throws:
java.io.IOException - if an I/O exception occurred.

next

public final boolean next()
                   throws java.io.IOException
Fowards the cursor and returns whether a next key, value pair exists.

Uses and updates the key, value pair cursor.

If a next key exists then this method sets the current value to the first value of the new key.

Specified by:
next in interface Iterator
Returns:
whether a next key, value pair exists.
Throws:
java.io.IOException - if an I/O exception occurred.

next

public final boolean next(IndexFilter filter)
                   throws java.io.IOException
Forwards the cursor and returns whether a next key, value pair exists that meets the specified criteria.

Uses and updates the key, value pair cursor.

If a next key exists then this method sets the current value to the first value of the new key.

Specified by:
next in interface Iterator
Parameters:
filter - the IndexFilter that evaluates whether key, value pairs match the criteria.
Returns:
whether a next key, value pair exists that meets the specified criteria.
Throws:
java.io.IOException - if an I/O exception occurred.

nextKey

public final java.lang.Object nextKey()
                               throws java.io.IOException
Returns the next key.

Uses and updates the key, value pair cursor.

If a next key exists then this method sets the current value to the first value of the new key.

Specified by:
nextKey in interface Iterator
Returns:
the next key. null if none exists.
Throws:
java.io.IOException - if an I/O exception occurred.

nextKey

public final java.lang.Object nextKey(IndexFilter filter)
                               throws java.io.IOException
Returns the next key that meets the specified criteria.

Uses and updates the key, value pair cursor.

If a next key exists then this method sets the current value to the first value of the new key.

Specified by:
nextKey in interface Iterator
Parameters:
filter - the IndexFilter that evaluates whether key, value pairs match the criteria.
Returns:
the next key. null if none exists.
Throws:
java.io.IOException - if an I/O exception occurred.

nextValue

public final java.lang.Object nextValue()
                                 throws java.io.IOException
Returns the next value.

Uses and updates the key, value pair cursor.

Specified by:
nextValue in interface Iterator
Returns:
the next value. null if none exists.
Throws:
java.io.IOException - if an I/O exception occurred.

nextValue

public final java.lang.Object nextValue(boolean all_keys)
                                 throws java.io.IOException
Returns the next value.

Uses and updates the key, value pair cursor.

Specified by:
nextValue in interface Iterator
Parameters:
all_keys - whether to return the next value for all keys or for only the current key.
Returns:
the next value. null if none exists.
Throws:
java.io.IOException - if an I/O exception occurred.

nextValue

public final java.lang.Object nextValue(IndexFilter filter)
                                 throws java.io.IOException
Returns the next value that meets the specified criteria.

Uses and updates the key, value pair cursor.

Specified by:
nextValue in interface Iterator
Parameters:
filter - the IndexFilter that evaluates whether key, value pairs match the criteria.
Returns:
the next value. null if none exists.
Throws:
java.io.IOException - if an I/O exception occurred.

nextValue

public final java.lang.Object nextValue(IndexFilter filter,
                                        boolean all_keys)
                                 throws java.io.IOException
Returns the next value that meets the specified criteria.

Uses and updates the key, value pair cursor.

Specified by:
nextValue in interface Iterator
Parameters:
filter - the IndexFilter that evaluates whether key, value pairs match the criteria.
all_keys - whether to return the next value for all keys or for only the current key.
Returns:
the next value. null if none exists.
Throws:
java.io.IOException - if an I/O exception occurred.

duplicates

public final boolean duplicates()
                         throws java.io.IOException
Returns whether the default index supports duplicates.

Specified by:
duplicates in interface Iterator
Returns:
whether the default index supports duplicates.
Throws:
java.io.IOException - if an I/O exception occurred.

ascending

public final boolean ascending()
                        throws java.io.IOException
Returns whether the default index is sorted in ascending order.

Specified by:
ascending in interface Iterator
Returns:
whether the default index is sorted in ascending order.
Throws:
java.io.IOException - if an I/O exception occurred.

seek

public final boolean seek(java.lang.Object key)
                   throws java.io.IOException
Sets the current cursor to the specified key.

Changes the key, value pair cursor.

If the specified key does not exist then calls to getCurrentKey() and getCurrentValue() will return null.

Specified by:
seek in interface Iterator
Parameters:
key - the key to set as the current key.
Returns:
whether the specified key exists.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.2.0 12/03/2002

seek

public final boolean seek(java.lang.Object key,
                          java.lang.Object id)
                   throws java.io.IOException
Sets the current cursor to the specified key, value pair.

Changes the key, value pair cursor.

If the specified key, value pair does not exist then calls to getCurrentKey() and getCurrentValue() will return null.

Specified by:
seek in interface Iterator
Parameters:
key - the key to set as the current key.
value - the value to set as the current value.
Returns:
whether the specified key, value pair exists.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.2.0 12/03/2002

getKeysClassName

public final java.lang.String getKeysClassName()
                                        throws java.io.IOException
Returns the keys class name for the default index.

Returns:
the keys class name for the default index.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.2.2 03/03/2003

getValuesClassName

public final java.lang.String getValuesClassName()
                                          throws java.io.IOException
Returns the values class name for the default index.

Returns:
the values class name for the default index.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.2.2 03/03/2003

getKeysIndexCollator

public final java.lang.String getKeysIndexCollator()
                                            throws java.io.IOException
Returns the class name of the keys index collator for the default index.

Returns:
the class name of the keys index collator for the default index.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.2.2 03/03/2003

getValuesIndexCollator

public final java.lang.String getValuesIndexCollator()
                                              throws java.io.IOException
Returns the class name of the values index collator for the default index.

Returns:
the class name of the values index collator for the default index.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.2.2 03/03/2003

getFilename

public final java.lang.String getFilename()
Returns the filename of the store this reference references.

Returns:
the filename of the store this reference references.
Since:
1.3.1 11/26/2003

Servertec
Persistent Object Store
1.4.1 09/04/2005

Copyright © 2001-2005 Servertec. All rights reserved.