com.enspire.gemini.bidirectional
Class BidirectionalIterator

java.lang.Object
  extended by com.enspire.gemini.bidirectional.BidirectionalIterator
All Implemented Interfaces:
java.util.Iterator

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

e-nspire site

Decorator around another Iterator. Ensures bidirectional behaviour over iterated elements.

Since:
1.0
Author:
Dragan Djuric

Constructor Summary
BidirectionalIterator(BidirectionalProperty bidirectionalProperty, java.util.Iterator iterator)
          Constructor that decorates the specified iterator.
 
Method Summary
 BidirectionalProperty getBidirectionalProperty()
           
 java.util.Iterator getDecorated()
           
 java.lang.Object getLast()
           
 boolean hasNext()
           
 java.lang.Object next()
           
 void remove()
          Removes the current element and updates the opposite property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BidirectionalIterator

public BidirectionalIterator(BidirectionalProperty bidirectionalProperty,
                             java.util.Iterator iterator)
Constructor that decorates the specified iterator.

Parameters:
bidirectionalProperty - the source of the decorated iterator
iterator - the iterator to decorate, must not be null
Throws:
java.lang.IllegalArgumentException - if the collection is null
Method Detail

getDecorated

public java.util.Iterator getDecorated()
Returns:
Returns the decorated.

getBidirectionalProperty

public BidirectionalProperty getBidirectionalProperty()
Returns:
Returns the bidirectionalProperty.

getLast

public java.lang.Object getLast()
Returns:
Returns the last.

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator
See Also:
Iterator.hasNext()

next

public java.lang.Object next()
Specified by:
next in interface java.util.Iterator
See Also:
Iterator.next()

remove

public void remove()
Removes the current element and updates the opposite property.

Specified by:
remove in interface java.util.Iterator
See Also:
Iterator.remove()


Copyright © 2005 e-nspire. All Rights Reserved.