org.apache.directory.server.core.partition.impl.btree
Class TupleEnumeration

java.lang.Object
  extended byorg.apache.directory.server.core.partition.impl.btree.TupleEnumeration
All Implemented Interfaces:
java.util.Enumeration, javax.naming.NamingEnumeration

public class TupleEnumeration
extends java.lang.Object
implements javax.naming.NamingEnumeration

A NamingEnumeration that returns underlying Iterator values for a single key as Tuples.

WARNING: The tuple returned is reused every time for efficiency and populated a over and over again with the new value. The key never changes.

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

Constructor Summary
TupleEnumeration(java.lang.Object key, java.util.Iterator iterator)
          Creates a cursor over an Iterator of single key's values
 
Method Summary
 void close()
           
 boolean hasMore()
          Checks if another value is available.
 boolean hasMoreElements()
          Checks if another value is available.
 java.lang.Object next()
          Gets the next value as a Tuple.
 java.lang.Object nextElement()
          Gets the next value as a Tuple.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TupleEnumeration

public TupleEnumeration(java.lang.Object key,
                        java.util.Iterator iterator)
Creates a cursor over an Iterator of single key's values

Parameters:
key - the keys whose duplicate values are to be returned
iterator - the underlying iterator this cursor uses
Method Detail

next

public java.lang.Object next()
Gets the next value as a Tuple.

Specified by:
next in interface javax.naming.NamingEnumeration
See Also:
NamingEnumeration.next()

nextElement

public java.lang.Object nextElement()
Gets the next value as a Tuple.

Specified by:
nextElement in interface java.util.Enumeration
See Also:
Enumeration.nextElement()

hasMore

public boolean hasMore()
Checks if another value is available.

Specified by:
hasMore in interface javax.naming.NamingEnumeration
See Also:
NamingEnumeration.hasMore()

hasMoreElements

public boolean hasMoreElements()
Checks if another value is available.

Specified by:
hasMoreElements in interface java.util.Enumeration
See Also:
Enumeration.hasMoreElements()

close

public void close()
Specified by:
close in interface javax.naming.NamingEnumeration
See Also:
NamingEnumeration.close()