org.melati.poem.util
Class LimitedEnumeration<T>

Package class diagram package LimitedEnumeration
java.lang.Object
  extended by org.melati.poem.util.LimitedEnumeration<T>
All Implemented Interfaces:
Enumeration<T>, SkipEnumeration<T>

public class LimitedEnumeration<T>
extends Object
implements SkipEnumeration<T>

An Enumeration representing the first n elements of another Enumeration.


Constructor Summary
LimitedEnumeration(Enumeration<T> base, int limit)
          Constructor.
 
Method Summary
 boolean hasMoreElements()
          
 T nextElement()
          
 void skip()
          Skip an Element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LimitedEnumeration

public LimitedEnumeration(Enumeration<T> base,
                          int limit)
Constructor.

Parameters:
base - the underlying Enumeration
limit - the excluded limit
Method Detail

hasMoreElements

public boolean hasMoreElements()

Specified by:
hasMoreElements in interface Enumeration<T>
See Also:
Enumeration.hasMoreElements()

nextElement

public T nextElement()
              throws NoSuchElementException

Specified by:
nextElement in interface Enumeration<T>
Throws:
NoSuchElementException
See Also:
Enumeration.nextElement()

skip

public void skip()
          throws NoSuchElementException
Skip an Element.

Specified by:
skip in interface SkipEnumeration<T>
Throws:
NoSuchElementException - if there are no more Elements
See Also:
SkipEnumeration.skip()


Copyright © 2000-2010 PanEris. All Rights Reserved.