net.sf.zig_project.gpl.common.queue
Class ArrayQueue.ArraySequencer
java.lang.Object
net.sf.zig_project.gpl.common.enumerations.ArrayEnum
net.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
|
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
usewrap
protected boolean usewrap
ArrayQueue.ArraySequencer
protected ArrayQueue.ArraySequencer(ArrayQueue q)
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 intooff
- the offset within the target array to
start copying elementslen
- the number of elements to copy