de.knipp.rritoolkit
Class KVList.SingletonIterator<E>

java.lang.Object
  extended by de.knipp.rritoolkit.KVList.SingletonIterator<E>
Type Parameters:
E - the value type
All Implemented Interfaces:
java.util.Iterator<E>
Enclosing class:
KVList

private static class KVList.SingletonIterator<E>
extends java.lang.Object
implements java.util.Iterator<E>

small class repesenting a singleton iterator

Version:
$Revision: 14936 $
Author:
Klaus Malorny

Field Summary
private  boolean first
          flag whether we are at the first element
private  E value
          the value
 
Constructor Summary
KVList.SingletonIterator(E v)
          constructor
 
Method Summary
 boolean hasNext()
          return whether there are more elements
 E next()
          return the first element
 void remove()
          remove the current element
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

value

private E value
the value


first

private boolean first
flag whether we are at the first element

Constructor Detail

KVList.SingletonIterator

public KVList.SingletonIterator(E v)
constructor

Parameters:
v - the value
Method Detail

hasNext

public boolean hasNext()
return whether there are more elements

Specified by:
hasNext in interface java.util.Iterator<E>
Returns:
true if so

next

public E next()
       throws java.util.NoSuchElementException
return the first element

Specified by:
next in interface java.util.Iterator<E>
Returns:
the element
Throws:
java.util.NoSuchElementException - on attempts to read past the end

remove

public void remove()
            throws java.lang.UnsupportedOperationException
remove the current element

Specified by:
remove in interface java.util.Iterator<E>
Throws:
java.lang.UnsupportedOperationException - always


Copyright © 2005-2011 Knipp Medien und Kommunikation GmbH