org.apache.directory.server.core.avltree
Class AvlTreeMapNoDupsWrapperCursor<K,V>

java.lang.Object
  extended by org.apache.directory.server.xdbm.AbstractTupleCursor<K,V>
      extended by org.apache.directory.server.core.avltree.AvlTreeMapNoDupsWrapperCursor<K,V>
All Implemented Interfaces:
java.lang.Iterable<Tuple<K,V>>, TupleCursor<K,V>, org.apache.directory.shared.ldap.cursor.Cursor<Tuple<K,V>>

public class AvlTreeMapNoDupsWrapperCursor<K,V>
extends AbstractTupleCursor<K,V>

A cursor that converts SingletonOrOrderedSet objects in the value from a AvlTreeMap into Tuples with just K and V presuming that all the keys have no duplicates.

Version:
$Rev$, $Date$
Author:
Apache Directory Project

Constructor Summary
AvlTreeMapNoDupsWrapperCursor(AvlSingletonOrOrderedSetCursor<K,V> wrapped)
           
 
Method Summary
 void after(Tuple<K,V> element)
           
 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 afterLast()
           
 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.
 boolean available()
           
 void before(Tuple<K,V> element)
           
 void beforeFirst()
           
 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.
 boolean first()
           
 Tuple<K,V> get()
           
 boolean isElementReused()
           
 boolean last()
           
 boolean next()
           
 boolean previous()
           
 
Methods inherited from class org.apache.directory.server.xdbm.AbstractTupleCursor
checkNotClosed, close, close, isClosed, iterator, setClosureMonitor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AvlTreeMapNoDupsWrapperCursor

public AvlTreeMapNoDupsWrapperCursor(AvlSingletonOrOrderedSetCursor<K,V> wrapped)
Method Detail

afterKey

public void afterKey(K key)
              throws java.lang.Exception
Description copied from interface: TupleCursor
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:
java.lang.Exception - if there are faults peforming this operation

afterValue

public void afterValue(K key,
                       V value)
                throws java.lang.Exception
Description copied from interface: TupleCursor
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:
java.lang.UnsupportedOperationException - if duplicate keys not supporrted
java.lang.Exception - if there are faults peforming this operation

beforeKey

public void beforeKey(K key)
               throws java.lang.Exception
Description copied from interface: TupleCursor
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:
java.lang.Exception - if there are faults peforming this operation

beforeValue

public void beforeValue(K key,
                        V value)
                 throws java.lang.Exception
Description copied from interface: TupleCursor
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:
java.lang.UnsupportedOperationException - if duplicate keys not supporrted
java.lang.Exception - if there are faults peforming this operation

after

public void after(Tuple<K,V> element)
           throws java.lang.Exception
Throws:
java.lang.Exception

afterLast

public void afterLast()
               throws java.lang.Exception
Throws:
java.lang.Exception

available

public boolean available()

before

public void before(Tuple<K,V> element)
            throws java.lang.Exception
Throws:
java.lang.Exception

beforeFirst

public void beforeFirst()
                 throws java.lang.Exception
Throws:
java.lang.Exception

first

public boolean first()
              throws java.lang.Exception
Throws:
java.lang.Exception

get

public Tuple<K,V> get()
               throws java.lang.Exception
Throws:
java.lang.Exception

isElementReused

public boolean isElementReused()

last

public boolean last()
             throws java.lang.Exception
Throws:
java.lang.Exception

next

public boolean next()
             throws java.lang.Exception
Throws:
java.lang.Exception

previous

public boolean previous()
                 throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.