|
Servertec Persistent Object Store 1.4.1 09/04/2005 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectstec.pos.IndexReference
public final class IndexReference
Handle to the persistent Index returned by Index.open() used to interface with the opened Index.
open
Method Summary | |
---|---|
boolean |
add(java.lang.Object key,
java.lang.Object value)
Adds the specified key, value pair to the index. |
boolean |
ascending()
Returns whether the current 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 Index. |
void |
close()
Closes this handle to the Index. |
boolean |
contains(java.lang.Object key,
java.lang.Object value)
Returns whether the Index contains the specified key, value pair. |
boolean |
containsKey(java.lang.Object key)
Returns whether the Index contains the specified key associated with any value. |
boolean |
containsValue(java.lang.Object value)
Returns whether the Index contains the specified value associated with any key. |
boolean |
duplicates()
Returns whether the current 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 first value associated with the specified key and sets the current key, value pair cursor. |
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 |
getFilename()
Returns the filename of the index this reference references. |
java.lang.String |
getKeysClassName()
Returns the keys class name. |
java.lang.String |
getKeysIndexCollator()
Returns the class name of the keys index collator. |
java.lang.String |
getValuesClassName()
Returns the values class name. |
java.lang.String |
getValuesIndexCollator()
Returns the class name of the values index collator. |
boolean |
iLocked(java.lang.Object key)
Returns whether the current IndexReference has locked the specified key. |
boolean |
iReadLocked(java.lang.Object key)
Returns whether the current IndexReference has read locked the specified key. |
boolean |
isEmpty()
Returns whether the Index is empty. |
boolean |
isLocked(java.lang.Object key)
Returns whether the specified key is locked. |
boolean |
isOpen()
Returns whether the current IndexReference is still open. |
boolean |
isReadLocked(java.lang.Object key)
Returns whether the specified read key is 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 IndexReference 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 |
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 Index. |
void |
remove(java.lang.Object key)
Removes the specified key and associated values from the Index. |
void |
remove(java.lang.Object key,
java.lang.Object value)
Removes the specified key, value pair from the Index. |
boolean |
seek(java.lang.Object key)
Sets the current cursor to the specified key. |
boolean |
seek(java.lang.Object key,
java.lang.Object value)
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 value)
Sets the current cursor to the specified existing key, value pair. |
int |
size()
Returns the number of key, value pairs in the Index. |
void |
unlock(java.lang.Object key)
Unlocks the specified key. |
void |
unlockAll()
Clears all the locks to this Index. |
void |
unlockMine()
Clears all the locks for the current IndexReference. |
int |
valueCount(java.lang.Object key)
Returns the number of duplicate values associated with the specified key in the Index. |
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 |
---|
public final void close() throws java.io.IOException
java.io.IOException
- if an I/O exception occurred.open
public final boolean add(java.lang.Object key, java.lang.Object value) throws java.io.IOException
key
- the key to add.value
- the value to associate with the specified key.
java.io.IOException
- if an I/O exception occurred.remove
,
remove
,
remove
public final void remove(java.lang.Object key) throws java.io.IOException
Invalidates the key, value pair cursor.
key
- the key to remove.
java.io.IOException
- if an I/O exception occurred.remove
,
remove
,
add
public final void remove(java.lang.Object key, java.lang.Object value) throws java.io.IOException
Invalidates the key, value pair cursor.
key
- the key to remove.value
- the associated value to remove.
java.io.IOException
- if an I/O exception occurred.remove
,
remove
,
add
public final void remove() throws java.io.IOException
Invalidates the key, value pair cursor.
java.io.IOException
- if an I/O exception occurred.remove
,
remove
,
add
public final java.lang.Object get(java.lang.Object key) throws java.io.IOException
Changes the key, value pair cursor if the specified key was found.
key
- the key to retrieve.
java.io.IOException
- if an I/O exception occurred.public final boolean containsKey(java.lang.Object key) throws java.io.IOException
key
- the key to test.
java.io.IOException
- if an I/O exception occurred.containsValue
,
contains
public final boolean containsValue(java.lang.Object value) throws java.io.IOException
value
- the value to test.
java.io.IOException
- if an I/O exception occurred.containsKey
,
contains
public final boolean contains(java.lang.Object key, java.lang.Object value) throws java.io.IOException
key
- the key to test.value
- the value to test.
java.io.IOException
- if an I/O exception occurred.containsKey
,
containsValue
public final boolean setCursor(java.lang.Object key, java.lang.Object value) throws java.io.IOException
Changes the key, value pair cursor if the specified key, value pair was found.
setCursor
in interface Iterator
key
- the key to set as the current key.value
- the value to set as the current value.
java.io.IOException
- if an I/O exception occurred.public final java.lang.Object getCurrentKey() throws java.io.IOException
Uses the key cursor.
getCurrentKey
in interface Iterator
java.io.IOException
- if an I/O exception occurred.public final java.lang.Object getCurrentValue() throws java.io.IOException
Uses the value cursor.
getCurrentValue
in interface Iterator
java.io.IOException
- if an I/O exception occurred.public final boolean setCurrentKey(java.lang.Object key) throws java.io.IOException
Changes the key, value pair cursor if the specified key was found.
setCurrentKey
in interface Iterator
key
- the key to set as the current key.
java.io.IOException
- if an I/O exception occurred.public final boolean setCurrentValue(java.lang.Object value) throws java.io.IOException
Changes the value cursor if the specified value was found.
setCurrentValue
in interface Iterator
value
- the value to set as the current value.
java.io.IOException
- if an I/O exception occurred.public final boolean first() throws java.io.IOException
Changes the key, value pair cursor.
first
in interface Iterator
java.io.IOException
- if an I/O exception occurred.public final boolean last() throws java.io.IOException
Changes the key, value pair cursor.
last
in interface Iterator
java.io.IOException
- if an I/O exception occurred.public final boolean atFirst() throws java.io.IOException
Uses the key, value pair cursor.
atFirst
in interface Iterator
java.io.IOException
- if an I/O exception occurred.public final boolean atLast() throws java.io.IOException
Uses the key, value pair cursor.
atLast
in interface Iterator
java.io.IOException
- if an I/O exception occurred.public final boolean isSet() throws java.io.IOException
Uses the key, value pair cursor.
isSet
in interface Iterator
java.io.IOException
- if an I/O exception occurred.public final boolean previous() throws java.io.IOException
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.
previous
in interface Iterator
java.io.IOException
- if an I/O exception occurred.public final boolean previous(IndexFilter filter) throws java.io.IOException
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.
previous
in interface Iterator
filter
- the IndexFilter that evaluates whether key, value pairs match the criteria.
java.io.IOException
- if an I/O exception occurred.public final java.lang.Object previousKey() throws java.io.IOException
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.
previousKey
in interface Iterator
java.io.IOException
- if an I/O exception occurred.public final java.lang.Object previousValue() throws java.io.IOException
Uses and updates the key, value pair cursor.
previousValue
in interface Iterator
java.io.IOException
- if an I/O exception occurred.public final java.lang.Object previousValue(boolean all_keys) throws java.io.IOException
Uses and updates the key, value pair cursor.
previousValue
in interface Iterator
all_keys
- whether to return the previous value for all keys or for only the current key.
java.io.IOException
- if an I/O exception occurred.public final java.lang.Object previousKey(IndexFilter filter) throws java.io.IOException
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.
previousKey
in interface Iterator
filter
- the IndexFilter that evaluates whether key, value pairs match the criteria.
java.io.IOException
- if an I/O exception occurred.public final java.lang.Object previousValue(IndexFilter filter) throws java.io.IOException
Uses and updates the key, value pair cursor.
previousValue
in interface Iterator
filter
- the IndexFilter that evaluates whether key, value pairs match the criteria.
java.io.IOException
- if an I/O exception occurred.public final java.lang.Object previousValue(IndexFilter filter, boolean all_keys) throws java.io.IOException
Uses and updates the key, value pair cursor.
previousValue
in interface Iterator
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.
java.io.IOException
- if an I/O exception occurred.public final boolean next() throws java.io.IOException
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.
next
in interface Iterator
java.io.IOException
- if an I/O exception occurred.public final boolean next(IndexFilter filter) throws java.io.IOException
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.
next
in interface Iterator
filter
- the IndexFilter that evaluates whether key, value pairs match the criteria.
java.io.IOException
- if an I/O exception occurred.public final java.lang.Object nextKey() throws java.io.IOException
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.
nextKey
in interface Iterator
java.io.IOException
- if an I/O exception occurred.public final java.lang.Object nextValue() throws java.io.IOException
Uses and updates the key, value pair cursor.
nextValue
in interface Iterator
java.io.IOException
- if an I/O exception occurred.public final java.lang.Object nextValue(boolean all_keys) throws java.io.IOException
Uses and updates the key, value pair cursor.
nextValue
in interface Iterator
all_keys
- whether to return the next value for all keys or for only the current key.
java.io.IOException
- if an I/O exception occurred.public final java.lang.Object nextKey(IndexFilter filter) throws java.io.IOException
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.
nextKey
in interface Iterator
filter
- the IndexFilter that evaluates whether key, value pairs match the criteria.
java.io.IOException
- if an I/O exception occurred.public final java.lang.Object nextValue(IndexFilter filter) throws java.io.IOException
Uses and updates the key, value pair cursor.
nextValue
in interface Iterator
filter
- the IndexFilter that evaluates whether key, value pairs match the criteria.
java.io.IOException
- if an I/O exception occurred.public final java.lang.Object nextValue(IndexFilter filter, boolean all_keys) throws java.io.IOException
Uses and updates the key, value pair cursor.
nextValue
in interface Iterator
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.
java.io.IOException
- if an I/O exception occurred.public final int size() throws java.io.IOException
java.io.IOException
- if an I/O exception occurred.public final boolean isEmpty() throws java.io.IOException
isEmpty
in interface Iterator
java.io.IOException
- if an I/O exception occurred.public final int valueCount(java.lang.Object key) throws java.io.IOException
valueCount
in interface Iterator
key
- the key whose values will be counted.
java.io.IOException
- if an I/O exception occurred.public final void clear() throws java.io.IOException
Also removes all locks.
java.io.IOException
- if an I/O exception occurred.public final void lock(java.lang.Object key) throws java.io.IOException
Same as writeLock().
If the key is already read or write locked by another stec.pos.IndexReference 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.IndexReference.unlock(Object), the Index is cleared by a call to stec.pos.IndexReference.clear() or the stec.pos.IndexReference is closed.
key
- the key to write lock. key cannot be null.
java.io.IOException
- if an I/O exception occurred.readLock
,
writeLock
,
lock
,
readLock
,
writeLock
,
unlock
,
unlockAll
,
unlockMine
public final void readLock(java.lang.Object key) throws java.io.IOException
If the key is already write locked by another stec.pos.IndexReference 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.IndexReference.unlock(Object), the Index is cleared by a call to stec.pos.IndexReference.clear() or the stec.pos.IndexReference is closed.
key
- the key to read lock. key cannot be null.
java.io.IOException
- if an I/O exception occurred.lock
,
writeLock
,
lock
,
readLock
,
writeLock
,
unlock
,
unlockAll
,
unlockMine
public final void writeLock(java.lang.Object key) throws java.io.IOException
If the key is already read or write locked by another stec.pos.IndexReference 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.IndexReference.unlock(Object), the Index is cleared by a call to stec.pos.IndexReference.clear() or the stec.pos.IndexReference is closed.
key
- the key to write lock. key cannot be null.
java.io.IOException
- if an I/O exception occurred.lock
,
readLock
,
lock
,
readLock
,
writeLock
,
unlock
,
unlockAll
,
unlockMine
public final boolean lock(java.lang.Object key, long timeout) throws java.io.IOException
Same as writeLock().
If the key is already read or write locked by another stec.pos.IndexReference 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.IndexReference.unlock(Object), the Index is cleared by a call to stec.pos.IndexReference.clear() or the stec.pos.IndexReference is closed.
key
- the key to write lock. key cannot be null.timeout
- the number of milliseconds to wait. -1 for unlimited
java.io.IOException
- if an I/O exception occurred.lock
,
readLock
,
writeLock
,
readLock
,
writeLock
,
unlock
,
unlockAll
,
unlockMine
public final boolean readLock(java.lang.Object key, long timeout) throws java.io.IOException
If the key is already write locked by another stec.pos.IndexReference 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.IndexReference.unlock(Object), the Index is cleared by a call to stec.pos.IndexReference.clear() or the stec.pos.IndexReference is closed.
key
- the key to read lock. key cannot be null.timeout
- the number of milliseconds to wait. -1 for unlimited
java.io.IOException
- if an I/O exception occurred.lock
,
readLock
,
writeLock
,
lock
,
writeLock
,
unlock
,
unlockAll
,
unlockMine
public final boolean writeLock(java.lang.Object key, long timeout) throws java.io.IOException
If the key is already read or write locked by another stec.pos.IndexReference 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.IndexReference.unlock(Object), the Index is cleared by a call to stec.pos.IndexReference.clear() or the stec.pos.IndexReference is closed.
key
- the key to write lock. key cannot be null.timeout
- the number of milliseconds to wait. -1 for unlimited
java.io.IOException
- if an I/O exception occurred.lock
,
readLock
,
writeLock
,
lock
,
readLock
,
unlock
,
unlockAll
,
unlockMine
public final void unlock(java.lang.Object key) throws java.io.IOException
key
- the key to unlock. key cannot be null.
java.io.IOException
- if the specified key is locked by another stec.pos.IndexReference or if an I/O exception occurred.lock
,
readLock
,
writeLock
,
lock
,
readLock
,
writeLock
,
unlockAll
,
unlockMine
public final void unlockAll() throws java.io.IOException
java.io.IOException
- if an I/O exception occurred.lock
,
readLock
,
writeLock
,
lock
,
readLock
,
writeLock
,
unlock
,
unlockMine
public final void unlockMine() throws java.io.IOException
java.io.IOException
- if an I/O exception occurred.lock
,
readLock
,
writeLock
,
lock
,
readLock
,
writeLock
,
unlock
,
unlockAll
public final boolean isLocked(java.lang.Object key) throws java.io.IOException
key
- the key to test. key cannot be null.
java.io.IOException
- if an I/O exception occurred.isReadLocked
,
isWriteLocked
,
iLocked
,
iReadLocked
,
iWriteLocked
public final boolean isReadLocked(java.lang.Object key) throws java.io.IOException
key
- the key to test. key cannot be null.
java.io.IOException
- if an I/O exception occurred.isLocked
,
isWriteLocked
,
iLocked
,
iReadLocked
,
iWriteLocked
public final boolean isWriteLocked(java.lang.Object key) throws java.io.IOException
key
- the key to test. key cannot be null.
java.io.IOException
- if an I/O exception occurred.isLocked
,
isReadLocked
,
iLocked
,
iReadLocked
,
iWriteLocked
public final boolean iLocked(java.lang.Object key) throws java.io.IOException
key
- the key to test. key cannot be null.
java.io.IOException
- if an I/O exception occurred.isLocked
,
isReadLocked
,
isWriteLocked
,
iReadLocked
,
iWriteLocked
public final boolean iReadLocked(java.lang.Object key) throws java.io.IOException
key
- the key to test. key cannot be null.
java.io.IOException
- if an I/O exception occurred.isLocked
,
isReadLocked
,
isWriteLocked
,
iLocked
,
iWriteLocked
public final boolean iWriteLocked(java.lang.Object key) throws java.io.IOException
key
- the key to test. key cannot be null.
java.io.IOException
- if an I/O exception occurred.isLocked
,
isReadLocked
,
isWriteLocked
,
iLocked
,
iReadLocked
public int lockCount() throws java.io.IOException
java.io.IOException
- if an I/O exception occurred.lockCount
public int lockCount(java.lang.Object key) throws java.io.IOException
key
- the key check to use.
java.io.IOException
- if an I/O exception occurred.lockCount
public java.util.Enumeration locks() throws java.io.IOException
java.io.IOException
- if an I/O exception occurred.locks
,
Enumeration
,
LinkedList
public java.util.Enumeration locks(java.lang.Object key) throws java.io.IOException
key
- the object to use.
java.io.IOException
- if an I/O exception occurred.locks
,
Enumeration
,
Lock
public final boolean isOpen() throws java.io.IOException
isOpen
in interface Iterator
java.io.IOException
- if an I/O exception occurred.open
,
close
public final boolean duplicates() throws java.io.IOException
duplicates
in interface Iterator
java.io.IOException
- if an I/O exception occurred.public final boolean ascending() throws java.io.IOException
ascending
in interface Iterator
java.io.IOException
- if an I/O exception occurred.public final boolean seek(java.lang.Object key) throws java.io.IOException
Changes the key, value pair cursor.
If the specified key does not exist then calls to getCurrentKey() and getCurrentValue() will return null.
seek
in interface Iterator
key
- the key to set as the current key.
java.io.IOException
- if an I/O exception occurred.public final boolean seek(java.lang.Object key, java.lang.Object value) throws java.io.IOException
Changes the key, value pair cursor.
If the specified key, value pair does not exist then calls to getCurrentKey() and getCurrentValue() will return null.
seek
in interface Iterator
key
- the key to set as the current key.value
- the value to set as the current value.
java.io.IOException
- if an I/O exception occurred.public final java.lang.String getKeysClassName() throws java.io.IOException
java.io.IOException
- if an I/O exception occurred.public final java.lang.String getValuesClassName() throws java.io.IOException
java.io.IOException
- if an I/O exception occurred.public final java.lang.String getKeysIndexCollator() throws java.io.IOException
java.io.IOException
- if an I/O exception occurred.public final java.lang.String getValuesIndexCollator() throws java.io.IOException
java.io.IOException
- if an I/O exception occurred.public final java.lang.String getFilename()
|
Servertec Persistent Object Store 1.4.1 09/04/2005 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2001-2005 Servertec. All rights reserved.