EclipseLink 2.4.2, build 'v20130514-5956486' API Reference

org.eclipse.persistence.jpa.jpql.util.iterator
Class SingleElementListIterator<E>

java.lang.Object
  extended by org.eclipse.persistence.jpa.jpql.util.iterator.SingleElementListIterator<E>
All Implemented Interfaces:
java.lang.Iterable<E>, java.util.Iterator<E>, java.util.ListIterator<E>, IterableIterator<E>, IterableListIterator<E>

public class SingleElementListIterator<E>
extends java.lang.Object
implements IterableListIterator<E>

A SingleElementListIterator holds a single element and returns it with the first call to next(), at which point it will return false to any subsequent call to hasNext(). Likewise, it will return false to a call to hasPrevious()< until a call to next(), at which point a call to previous() will return the single element.

Version:
2.4
Since:
2.4

Constructor Summary
SingleElementListIterator(E element)
          Creates a new SingleElementListIterator that returns only the specified element.
 
Method Summary
 void add(E item)
          
 boolean hasNext()
          
 boolean hasPrevious()
          
 java.util.ListIterator<E> iterator()
          
 E next()
          
 int nextIndex()
          
 E previous()
          
 int previousIndex()
          
 void remove()
          
 void set(E item)
          
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SingleElementListIterator

public SingleElementListIterator(E element)
Creates a new SingleElementListIterator that returns only the specified element.

Parameters:
element - The only element of this Iterator
Method Detail

add

public void add(E item)

Specified by:
add in interface java.util.ListIterator<E>

hasNext

public boolean hasNext()

Specified by:
hasNext in interface java.util.Iterator<E>
Specified by:
hasNext in interface java.util.ListIterator<E>

hasPrevious

public boolean hasPrevious()

Specified by:
hasPrevious in interface java.util.ListIterator<E>

iterator

public java.util.ListIterator<E> iterator()

Specified by:
iterator in interface java.lang.Iterable<E>
Specified by:
iterator in interface IterableListIterator<E>

next

public E next()

Specified by:
next in interface java.util.Iterator<E>
Specified by:
next in interface java.util.ListIterator<E>

nextIndex

public int nextIndex()

Specified by:
nextIndex in interface java.util.ListIterator<E>

previous

public E previous()

Specified by:
previous in interface java.util.ListIterator<E>

previousIndex

public int previousIndex()

Specified by:
previousIndex in interface java.util.ListIterator<E>

remove

public void remove()

Specified by:
remove in interface java.util.Iterator<E>
Specified by:
remove in interface java.util.ListIterator<E>

set

public void set(E item)

Specified by:
set in interface java.util.ListIterator<E>

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

EclipseLink 2.4.2, build 'v20130514-5956486' API Reference