Package jade.util.leap
Class EmptyIterator
- java.lang.Object
-
- jade.util.leap.EmptyIterator
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IteratorgetInstance()Returns the singleton EmptyIterator object.booleanhasNext()Checks whether the iterator can scan further.Objectnext()Retrieves the next element in the collection scanned by this iterator.voidremove()Remove the element pointed to by this iterator from the collection.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Method Detail
-
getInstance
public static Iterator getInstance()
Returns the singleton EmptyIterator object. Most of the methods of this class are instance methods and must be invoked with respect to the singleton object.
-
hasNext
public boolean hasNext()
Checks whether the iterator can scan further.
-
next
public Object next()
Retrieves the next element in the collection scanned by this iterator.- Specified by:
nextin interfaceIterator- Returns:
- This method always throws an exception.
- Throws:
NoSuchElementException- Always, because the underlying collection is always empty.
-
remove
public void remove()
Remove the element pointed to by this iterator from the collection.- Specified by:
removein interfaceIterator- Throws:
RuntimeException- Always, because the underlying collection is always empty.
-
-