org.apache.directory.shared.ldap.model.cursor
Interface TupleCursor<K,V>

Type Parameters:
K - The Tuple key type
V - The Value type stored in the Tuple
All Superinterfaces:
Cursor<Tuple<K,V>>, Iterable<Tuple<K,V>>
All Known Implementing Classes:
AbstractTupleCursor

public interface TupleCursor<K,V>
extends Cursor<Tuple<K,V>>

A Cursor introducing new advance methods designed to reduce some inefficiencies encountered when scanning over Tuples.

Author:
Apache Directory Project

Method Summary
 void afterKey(K key)
          An alternative to calling after(Tuple) which often may require wrapping a key in a newly created Tuple object that may be unnecessary.
 void afterValue(K key, V value)
          An alternative to calling after(Tuple) which often may require wrapping a key and a value in a newly created Tuple object that may be unnecessary.
 void beforeKey(K key)
          An alternative to calling before(Tuple) which often may require wrapping a key in a newly created Tuple object that may be unnecessary.
 void beforeValue(K key, V value)
          An alternative to calling before(Tuple) which often may require wrapping a key and a value in a newly created Tuple object that may be unnecessary.
 
Methods inherited from interface org.apache.directory.shared.ldap.model.cursor.Cursor
after, afterLast, available, before, beforeFirst, close, close, first, get, isAfterLast, isBeforeFirst, isClosed, isFirst, isLast, last, next, previous, setClosureMonitor
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

beforeKey

void beforeKey(K key)
               throws Exception
An alternative to calling before(Tuple) which often may require wrapping a key in a newly created Tuple object that may be unnecessary. This method behaves just like before(Tuple) except it advances to just before the first value of the key.

Parameters:
key - the key to advance just before
Throws:
Exception - if there are faults performing this operation

afterKey

void afterKey(K key)
              throws Exception
An alternative to calling after(Tuple) which often may require wrapping a key in a newly created Tuple object that may be unnecessary. This method behaves just like after(Tuple) except it advances to just after the last value of the key.

Parameters:
key - the key to advance just after the last value
Throws:
Exception - if there are faults performing this operation

beforeValue

void beforeValue(K key,
                 V value)
                 throws Exception
An alternative to calling before(Tuple) which often may require wrapping a key and a value in a newly created Tuple object that may be unnecessary. This method behaves just like before(Tuple) except it advances to just before the value of the key which may still be of the same key. This method will not be supported if duplicate keys are not supported. In this case an UnsupportedOperationException will be thrown.

Parameters:
key - the key of the value to advance just before
value - the value to advance just before
Throws:
Exception - if there are faults performing this operation

afterValue

void afterValue(K key,
                V value)
                throws Exception
An alternative to calling after(Tuple) which often may require wrapping a key and a value in a newly created Tuple object that may be unnecessary. This method behaves just like after(Tuple) except it advances to just after the value with the specified key. This method will not be supported if duplicate keys are not supported. In this case an UnsupportedOperationException will be thrown.

Parameters:
key - the key of the value to advance just after
value - the value to advance just after
Throws:
Exception - if there are faults performing this operation


Copyright © 2003-2012 The Apache Software Foundation. All Rights Reserved.