org.xshare.base.iterator
Class SkipNullIterator

java.lang.Object
  |
  +--org.xshare.base.iterator.SkipNullIterator
All Implemented Interfaces:
java.util.Iterator

public class SkipNullIterator
extends java.lang.Object
implements java.util.Iterator

Iterator which skips all null values of a given iteration.

Notes On The Implementation

Since:
0.20
Version:
$Revision: 1.1 $
Author:
Oliver Fischer

Constructor Summary
SkipNullIterator(java.util.Iterator pSourceIterator)
          Creates a new instance of this iterator class for a given iteration.
 
Method Summary
 boolean hasNext()
          Checks if this iteration has still elements left.
 java.lang.Object next()
          Returns the next element of the iteration.
 void remove()
          Calls the Iterator.remove() method of the underlying iteration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SkipNullIterator

public SkipNullIterator(java.util.Iterator pSourceIterator)
Creates a new instance of this iterator class for a given iteration.

Parameters:
pSourceIterator - a Iterator object pointing to the iteration of elements which should be filtered.
Method Detail

remove

public void remove()
Calls the Iterator.remove() method of the underlying iteration.

Specified by:
remove in interface java.util.Iterator

next

public java.lang.Object next()
Returns the next element of the iteration.

Specified by:
next in interface java.util.Iterator
Throws:
java.util.NoSuchElementException - if hasNext() denies the that there are objects left.
See Also:
hasNext()

hasNext

public boolean hasNext()
Checks if this iteration has still elements left.

Specified by:
hasNext in interface java.util.Iterator
Returns:
a boolean value, which is true if there are some elements left to return via next(). Otherwise false is returned.
See Also:
next()


jKiska Base 0.2.1 Release Esche [http://jkiska.sourceforge.net]