com.sun.sgs.app.util
Class ScalableList.ScalableListNodeIterator<E>

java.lang.Object
  extended by com.sun.sgs.app.util.ScalableList.ScalableListNodeIterator<E>
Type Parameters:
E - the type of element stored in the ScalableList
All Implemented Interfaces:
Serializable, Iterator<ScalableList.ListNode<E>>
Enclosing class:
ScalableList<E>

static class ScalableList.ScalableListNodeIterator<E>
extends Object
implements Serializable, Iterator<ScalableList.ListNode<E>>

This iterator walks through the ListNode<E>s which parent the SubLists. An iterator for this type of element is necessary to support the other element iterator as well as indexOf() operations.


Constructor Summary
ScalableList.ScalableListNodeIterator(ScalableList.ListNode<E> head)
          Constructor to create a new iterator.
 
Method Summary
 boolean hasNext()
          Determines if there is a next element to iterate over; that is, if the next ListNode is not null.
 boolean hasPrev()
          Determines if there is a previous element to iterate over; that is, if the previous ListNode is not null.
 ScalableList.ListNode<E> next()
          Returns the next ListNode<E> in order from the list
 ScalableList.ListNode<E> prev()
          Returns the previous ListNode<E> in order from the list
 void remove()
          Deprecated. this operation is not supported because the ScalableList only removes elements explicitly, not ListNodes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScalableList.ScalableListNodeIterator

ScalableList.ScalableListNodeIterator(ScalableList.ListNode<E> head)
Constructor to create a new iterator.

Parameters:
head - the head ListNode from which to begin iterating
Method Detail

hasNext

public boolean hasNext()
Determines if there is a next element to iterate over; that is, if the next ListNode is not null.

Specified by:
hasNext in interface Iterator<ScalableList.ListNode<E>>
Returns:
true if the next element is not null, and false otherwise

next

public ScalableList.ListNode<E> next()
Returns the next ListNode<E> in order from the list

Specified by:
next in interface Iterator<ScalableList.ListNode<E>>
Returns:
the next ListNode
Throws:
NoSuchElementException - if there exists no next sibling

hasPrev

public boolean hasPrev()
Determines if there is a previous element to iterate over; that is, if the previous ListNode is not null.

Returns:
true if the previous element is not null, and false otherwise

prev

public ScalableList.ListNode<E> prev()
Returns the previous ListNode<E> in order from the list

Returns:
the previous ListNode
Throws:
NoSuchElementException - if there exists no previous sibling

remove

public void remove()
Deprecated. this operation is not supported because the ScalableList only removes elements explicitly, not ListNodes.

Specified by:
remove in interface Iterator<ScalableList.ListNode<E>>
Throws:
UnsupportedOperationException - the operation is not supported

RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved