Packagenet.guttershark.util.collections
Classpublic final class ArrayBounceIterator

The ArrayBounceIterator class provides a non-destructive, pointer-based, bouncing array iterator which moves to the end of the array then reverses direction backward & forward.



Public Properties
 PropertyDefined by
  length : int
[read-only] The collection length.
ArrayBounceIterator
Public Methods
 MethodDefined by
  
ArrayBounceIterator(array:Array, isSkipRepeat:Boolean = true)
Constructor for ArrayBounceIterator instances.
ArrayBounceIterator
  
current():Object
The current element.
ArrayBounceIterator
  
dispose():void
Dispose of this iterator.
ArrayBounceIterator
  
hasNext():Boolean
There will always be a next item, as when the pointer is at the end, it switches direction.
ArrayBounceIterator
  
next():Object
The next element, or null.
ArrayBounceIterator
  
peek():Object
Return a peek of the next element without updating the array element pointer, or return null if none.
ArrayBounceIterator
  
reset():void
Resets the pointer.
ArrayBounceIterator
Property detail
lengthproperty
length:int  [read-only]

The collection length.

Implementation
    public function get length():int
Constructor detail
ArrayBounceIterator()constructor
public function ArrayBounceIterator(array:Array, isSkipRepeat:Boolean = true)

Constructor for ArrayBounceIterator instances.

Parameters
array:Array — The array to iterate over.
 
isSkipRepeat:Boolean (default = true) — If true iterate 0,1,2,1,0 rather than 0,1,2,2,1,0.
Method detail
current()method
public function current():Object

The current element.

Returns
Object
dispose()method 
public function dispose():void

Dispose of this iterator.

hasNext()method 
public function hasNext():Boolean

There will always be a next item, as when the pointer is at the end, it switches direction.

Returns
Boolean
next()method 
public function next():Object

The next element, or null.

Returns
Object
peek()method 
public function peek():Object

Return a peek of the next element without updating the array element pointer, or return null if none.

Returns
Object
reset()method 
public function reset():void

Resets the pointer.