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

java.lang.Object
  extended by org.apache.directory.server.core.partition.impl.btree.TupleEnumeration
All Implemented Interfaces:
java.util.Enumeration<Tuple>, javax.naming.NamingEnumeration<Tuple>

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

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: 567224 $
Author:
Apache Directory Project

Constructor Summary
TupleEnumeration(java.lang.Object key, java.util.Iterator<? extends java.lang.Object> 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.
 Tuple next()
          Gets the next value as a Tuple.
 Tuple 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<? extends java.lang.Object> 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 Tuple next()
Gets the next value as a Tuple.

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

nextElement

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

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

hasMore

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

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

hasMoreElements

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

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

close

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


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