net.sf.zig_project.gpl.common.queue
Class ArrayQueue.ArraySequencer

java.lang.Object
  extended bynet.sf.zig_project.gpl.common.enumerations.ArrayEnum
      extended bynet.sf.zig_project.gpl.common.queue.ArrayQueue.ArraySequencer
All Implemented Interfaces:
Enumeration
Enclosing class:
ArrayQueue

protected static class ArrayQueue.ArraySequencer
extends ArrayEnum

An Enumerable interface for ArrayQueue. This class overrides ArrayEnum in order to account for wrapping, where the beginning of the array may start at a higher index than the end of the array.


Field Summary
protected  boolean usewrap
           
 
Fields inherited from class net.sf.zig_project.gpl.common.enumerations.ArrayEnum
entries, index, term
 
Constructor Summary
protected ArrayQueue.ArraySequencer(ArrayQueue q)
           
 
Method Summary
 int available()
          Determines the current number of valid elements which the Enumeration can currently Enumerate over.
protected  void copyIntoRsvd(Object[] targ, int off, int len)
          Reserved internal method to enumerate over elements in this Enumeration, copying them into the target array.
 boolean hasMoreElements()
          Determines if the current Enumeration currently has any more elements to enumerate over.
 Object nextElement()
          Moves the position of this Enumeration to the next element and returns it.
 
Methods inherited from class net.sf.zig_project.gpl.common.enumerations.ArrayEnum
copyInto, copyInto
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

usewrap

protected boolean usewrap
Constructor Detail

ArrayQueue.ArraySequencer

protected ArrayQueue.ArraySequencer(ArrayQueue q)
Method Detail

nextElement

public Object nextElement()
Description copied from class: ArrayEnum
Moves the position of this Enumeration to the next element and returns it.

Specified by:
nextElement in interface Enumeration
Overrides:
nextElement in class ArrayEnum

hasMoreElements

public boolean hasMoreElements()
Description copied from class: ArrayEnum
Determines if the current Enumeration currently has any more elements to enumerate over.

Specified by:
hasMoreElements in interface Enumeration
Overrides:
hasMoreElements in class ArrayEnum

available

public int available()
Description copied from class: ArrayEnum
Determines the current number of valid elements which the Enumeration can currently Enumerate over.

Overrides:
available in class ArrayEnum
Returns:
the number of available elements

copyIntoRsvd

protected void copyIntoRsvd(Object[] targ,
                            int off,
                            int len)
Description copied from class: ArrayEnum
Reserved internal method to enumerate over elements in this Enumeration, copying them into the target array. Calls to this method are only made after the parameters have been verified as valid.

Overrides:
copyIntoRsvd in class ArrayEnum
Parameters:
targ - the array to copy elements into
off - the offset within the target array to start copying elements
len - the number of elements to copy