org.apache.directory.server.xdbm
Class AbstractTupleCursor<K,V>

java.lang.Object
  extended by org.apache.directory.server.xdbm.AbstractTupleCursor<K,V>
All Implemented Interfaces:
java.lang.Iterable<Tuple<K,V>>, Cursor<Tuple<K,V>>, TupleCursor<K,V>
Direct Known Subclasses:
DupsContainerCursor, KeyTupleAvlCursor, KeyTupleBTreeCursor

public abstract class AbstractTupleCursor<K,V>
extends java.lang.Object
implements TupleCursor<K,V>

An abstract TupleCursor.

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

Constructor Summary
AbstractTupleCursor()
           
 
Method Summary
protected  void checkNotClosed(java.lang.String operation)
           
 void close()
          Closes this Cursor and frees any resources it my have allocated.
 void close(java.lang.Exception cause)
          Closes this Cursor and frees any resources it my have allocated.
 boolean isClosed()
          Checks if this Curser is closed.
 java.util.Iterator<Tuple<K,V>> iterator()
           
 void setClosureMonitor(ClosureMonitor monitor)
          Sets a non-null closure monitor to associate with this Cursor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.directory.server.xdbm.TupleCursor
afterKey, afterValue, beforeKey, beforeValue
 
Methods inherited from interface org.apache.directory.server.core.cursor.Cursor
after, afterLast, available, before, beforeFirst, first, get, isElementReused, last, next, previous
 

Constructor Detail

AbstractTupleCursor

public AbstractTupleCursor()
Method Detail

setClosureMonitor

public final void setClosureMonitor(ClosureMonitor monitor)
Description copied from interface: Cursor
Sets a non-null closure monitor to associate with this Cursor.

Specified by:
setClosureMonitor in interface Cursor<Tuple<K,V>>
Parameters:
monitor - the monitor to use for detecting Cursor close events

checkNotClosed

protected final void checkNotClosed(java.lang.String operation)
                             throws java.lang.Exception
Throws:
java.lang.Exception

isClosed

public final boolean isClosed()
Description copied from interface: Cursor
Checks if this Curser is closed. Calls to this operation should not fail with exceptions if and only if the cursor is in the closed state.

Specified by:
isClosed in interface Cursor<Tuple<K,V>>
Returns:
true if this Cursor is closed, false otherwise

close

public void close()
           throws java.lang.Exception
Description copied from interface: Cursor
Closes this Cursor and frees any resources it my have allocated. Repeated calls to this method after this Cursor has already been called should not fail with exceptions.

Specified by:
close in interface Cursor<Tuple<K,V>>
Throws:
java.lang.Exception - if for some reason this Cursor could not be closed

close

public void close(java.lang.Exception cause)
           throws java.lang.Exception
Description copied from interface: Cursor
Closes this Cursor and frees any resources it my have allocated. Repeated calls to this method after this Cursor has already been called should not fail with exceptions. The reason argument is the Exception instance thrown instead of the standard CursorClosedException.

Specified by:
close in interface Cursor<Tuple<K,V>>
Parameters:
cause - exception thrown when this Cursor is accessed after close
Throws:
java.lang.Exception - if for some reason this Cursor could not be closed

iterator

public java.util.Iterator<Tuple<K,V>> iterator()
Specified by:
iterator in interface java.lang.Iterable<Tuple<K,V>>


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