Servertec
Persistent Object Store
1.4.1 09/04/2005

stec.pos
Interface Iterator

All Known Implementing Classes:
IndexedObjectStoreReference, IndexedObjectStoreReference, IndexReference, IndexReference

public interface Iterator

Interface defining methods used to transverse Indexes and IndexedObjectStores.

Since:
1.1.0 09/01/2002

Method Summary
 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.
 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 getCurrentKey()
          Returns the current key or null if none exists.
 java.lang.Object getCurrentValue()
          Returns the current value or null if none exists.
 boolean isEmpty()
          Returns whether the Index is empty.
 boolean isOpen()
          Returns whether the current IndexReference is still open.
 boolean isSet()
          Returns whether the key, value pair cursor is set to a key, value pair.
 boolean last()
          Attempt to set the cursor to the last key, value pair.
 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.
 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 valueCount(java.lang.Object key)
          Returns the number of duplicate values associated with the specified key in the Index.
 

Method Detail

setCursor

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

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

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 and if the current key, value pair cursor could be set to the specified key, value pair.
Throws:
java.io.IOException - if an I/O exception occurred.

getCurrentKey

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

Uses the key cursor.

Returns:
the current key. null if none.
Throws:
java.io.IOException - if an I/O exception occurred.

getCurrentValue

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

Uses the value cursor.

Returns:
the current value. null if none.
Throws:
java.io.IOException - if an I/O exception occurred.

setCurrentKey

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.

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

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.

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

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

Changes the key, value pair cursor.

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

last

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

Changes the key, value pair cursor.

Returns:
whether the cursor could be set to the last key. Returns false if the Index was empty.
Throws:
java.io.IOException - if an I/O exception occurred.

atFirst

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.

Returns:
whether the key, value pair cursor was at the first key, value pair. Returns false if the Index or IndexedObjectStore was empty.
Throws:
java.io.IOException - if an I/O exception occurred.

atLast

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.

Returns:
whether the key, value pair cursor was at the last key, value pair. Returns false if the Index or IndexedObjectStore was empty.
Throws:
java.io.IOException - if an I/O exception occurred.

isSet

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.

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

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.

Returns:
whether a prior key, value exists.
Throws:
java.io.IOException - if an I/O exception occurred.

previous

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.

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

previousKey

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.

Returns:
the previous key. null if none exists.
Throws:
java.io.IOException - if an I/O exception occurred.

previousValue

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

Uses and updates the key, value pair cursor.

Returns:
the previous value. null if none exists.
Throws:
java.io.IOException - if an I/O exception occurred.

previousValue

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

Uses and updates the key, value pair cursor.

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.

previousKey

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.

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

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.

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

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.

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

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.

Returns:
whether a next key, value exists.
Throws:
java.io.IOException - if an I/O exception occurred.

next

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.

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

nextKey

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.

Returns:
the next key. null if none exists.
Throws:
java.io.IOException - if an I/O exception occurred.

nextValue

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

Uses and updates the key, value pair cursor.

Returns:
the next value. null if none exists.
Throws:
java.io.IOException - if an I/O exception occurred.

nextValue

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

Uses and updates the key, value pair cursor.

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.

nextKey

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.

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

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.

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

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.

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.

isEmpty

boolean isEmpty()
                throws java.io.IOException
Returns whether the Index is empty.

Returns:
whether the Index was empty.
Throws:
java.io.IOException - if an I/O exception occurred.

valueCount

int valueCount(java.lang.Object key)
               throws java.io.IOException
Returns the number of duplicate values associated with the specified key in the Index.

Parameters:
key - the key whose values will be counted.
Returns:
the number of duplicate values associated with the specified key in the Index.
Throws:
java.io.IOException - if an I/O exception occurred.

isOpen

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

Returns:
whether the current IndexReference is open.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
open, close

duplicates

boolean duplicates()
                   throws java.io.IOException
Returns whether the current Index supports duplicates.

Returns:
whether the current Index supports duplicates.
Throws:
java.io.IOException - if an I/O exception occurred.

ascending

boolean ascending()
                  throws java.io.IOException
Returns whether the current Index is sorted in ascending order.

Returns:
whether the current Index is sorted in ascending order.
Throws:
java.io.IOException - if an I/O exception occurred.

seek

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.

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

boolean seek(java.lang.Object key,
             java.lang.Object value)
             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.

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

Servertec
Persistent Object Store
1.4.1 09/04/2005

Copyright © 2001-2005 Servertec. All rights reserved.