org.apache.directory.server.xdbm
Class AbstractIndexCursor<V,Entry,ID>

java.lang.Object
  extended by org.apache.directory.shared.ldap.model.cursor.AbstractCursor<IndexEntry<V,ID>>
      extended by org.apache.directory.server.xdbm.AbstractIndexCursor<V,Entry,ID>
All Implemented Interfaces:
Iterable<IndexEntry<V,ID>>, IndexCursor<V,Entry,ID>, org.apache.directory.shared.ldap.model.cursor.Cursor<IndexEntry<V,ID>>
Direct Known Subclasses:
AllEntriesCursor, AndCursor, ApproximateCursor, EmptyIndexCursor, EqualityCursor, GreaterEqCursor, LessEqCursor, NotCursor, OneLevelScopeCursor, OrCursor, PresenceCursor, SingletonIndexCursor, SubstringCursor, SubtreeScopeCursor

public abstract class AbstractIndexCursor<V,Entry,ID>
extends org.apache.directory.shared.ldap.model.cursor.AbstractCursor<IndexEntry<V,ID>>
implements IndexCursor<V,Entry,ID>

An abstract TupleCursor.

Author:
Apache Directory Project

Field Summary
protected static String UNSUPPORTED_MSG
          The message used for unsupported operations
 
Constructor Summary
AbstractIndexCursor()
           
 
Method Summary
 void after(IndexEntry<V,ID> element)
          
 void afterValue(ID id, V value)
          An alternative to calling after(IndexEntry) which often may require wrapping an id and value in a newly created IndexEntry object that may be an unnecessary object creation.
 boolean available()
          
 void before(IndexEntry<V,ID> element)
          
 void beforeValue(ID id, V value)
          An alternative to calling before(IndexEntry) which often may require wrapping an id and value in a newly created IndexEntry object that may be an unnecessary object creation.
protected abstract  String getUnsupportedMessage()
          Gets the message to return for operations that are not supported
 boolean isAfterLast()
          
 boolean isBeforeFirst()
          
 boolean isFirst()
          
 boolean isLast()
          
 Iterator<IndexEntry<V,ID>> iterator()
          
protected  boolean setAvailable(boolean available)
          
 
Methods inherited from class org.apache.directory.shared.ldap.model.cursor.AbstractCursor
checkNotClosed, close, close, isClosed, setClosureMonitor
 
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.shared.ldap.model.cursor.Cursor
afterLast, beforeFirst, close, close, first, get, isClosed, last, next, previous, setClosureMonitor
 

Field Detail

UNSUPPORTED_MSG

protected static final String UNSUPPORTED_MSG
The message used for unsupported operations

See Also:
Constant Field Values
Constructor Detail

AbstractIndexCursor

public AbstractIndexCursor()
Method Detail

available

public boolean available()

Specified by:
available in interface org.apache.directory.shared.ldap.model.cursor.Cursor<IndexEntry<V,ID>>

getUnsupportedMessage

protected abstract String getUnsupportedMessage()
Gets the message to return for operations that are not supported

Returns:
The Unsupported message

after

public void after(IndexEntry<V,ID> element)
           throws Exception

Specified by:
after in interface org.apache.directory.shared.ldap.model.cursor.Cursor<IndexEntry<V,ID>>
Throws:
Exception

before

public void before(IndexEntry<V,ID> element)
            throws Exception

Specified by:
before in interface org.apache.directory.shared.ldap.model.cursor.Cursor<IndexEntry<V,ID>>
Throws:
Exception

afterValue

public void afterValue(ID id,
                       V value)
                throws Exception
An alternative to calling after(IndexEntry) which often may require wrapping an id and value in a newly created IndexEntry object that may be an unnecessary object creation. Some implementations may not support this operation and may throw an UnsupportedOperationEception.

Specified by:
afterValue in interface IndexCursor<V,Entry,ID>
Parameters:
id - the id for the entry
value - the value to advance just after the last value
Throws:
Exception - if there are faults performing this operation

beforeValue

public void beforeValue(ID id,
                        V value)
                 throws Exception
An alternative to calling before(IndexEntry) which often may require wrapping an id and value in a newly created IndexEntry object that may be an unnecessary object creation. Some implementations may not support this operation and may throw an UnsupportedOperationEception.

Specified by:
beforeValue in interface IndexCursor<V,Entry,ID>
Parameters:
id - the id for the entry
value - the value to advance just before
Throws:
Exception - if there are faults performing this operation

setAvailable

protected boolean setAvailable(boolean available)


iterator

public Iterator<IndexEntry<V,ID>> iterator()

Specified by:
iterator in interface Iterable<IndexEntry<V,ID>>
Overrides:
iterator in class org.apache.directory.shared.ldap.model.cursor.AbstractCursor<IndexEntry<V,ID>>

isAfterLast

public boolean isAfterLast()
                    throws Exception

Specified by:
isAfterLast in interface org.apache.directory.shared.ldap.model.cursor.Cursor<IndexEntry<V,ID>>
Overrides:
isAfterLast in class org.apache.directory.shared.ldap.model.cursor.AbstractCursor<IndexEntry<V,ID>>
Throws:
Exception

isBeforeFirst

public boolean isBeforeFirst()
                      throws Exception

Specified by:
isBeforeFirst in interface org.apache.directory.shared.ldap.model.cursor.Cursor<IndexEntry<V,ID>>
Overrides:
isBeforeFirst in class org.apache.directory.shared.ldap.model.cursor.AbstractCursor<IndexEntry<V,ID>>
Throws:
Exception

isFirst

public boolean isFirst()
                throws Exception

Specified by:
isFirst in interface org.apache.directory.shared.ldap.model.cursor.Cursor<IndexEntry<V,ID>>
Overrides:
isFirst in class org.apache.directory.shared.ldap.model.cursor.AbstractCursor<IndexEntry<V,ID>>
Throws:
Exception

isLast

public boolean isLast()
               throws Exception

Specified by:
isLast in interface org.apache.directory.shared.ldap.model.cursor.Cursor<IndexEntry<V,ID>>
Overrides:
isLast in class org.apache.directory.shared.ldap.model.cursor.AbstractCursor<IndexEntry<V,ID>>
Throws:
Exception


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