|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RecordingListIterator
This iterator could be used to traverse entries in a RecordingList. An iterator for lists that allows the programmer to traverse the list in either direction and to obtain the iterator's current position in the list. A RecordingListIterator has no current element; its cursor position always lies between the element that would be returned by a call to previousEntry(), previousEntries(n), nextEntry(),and nextEntries(n), where each traverse backward by 1, n, and forward by 1, n respectively. In a list of length n, there are N+1 valid index values, from 0 to n, inclusive.
Element(0) Element(1) Element(2) ... Element(n) ^ ^ ^ ^ ^ Index: 0 1 2 3 N+1Total failure to traverse the list shall not change the position. When a request to traverses by n entries would result in going beyond the list, it shall traverse as much possible and change the position accordingly. The orders of the entries in the array returned by both nextEntries(n) or previousEntries(n) shall be the same the order maintained within the implementation.
Method Summary | |
---|---|
RecordingRequest |
getEntry(int index)
Gets the RecordingRequest object at the specified
position. |
int |
getPosition()
Gets the current position of the RecordingListIterator. |
int |
getPosition(RecordingRequest entry)
Gets the position of a specified recording request in the list. |
RecordingList |
getRecordingList()
Gets the recording list corresponding to this RecordingListIterator. |
boolean |
hasNext()
Tests if there is a RecordingRequest in the next
position in the list. |
boolean |
hasPrevious()
Tests if there is a RecordingRequest in the previous
position in the list. |
RecordingRequest[] |
nextEntries(int n)
Gets the next 'n' RecordingRequest objects in the list. |
RecordingRequest |
nextEntry()
Gets the next RecordingRequest object in the list. |
RecordingRequest[] |
previousEntries(int n)
Gets the previous 'n' RecordingRequest objects in the
list. |
RecordingRequest |
previousEntry()
Gets the previous RecordingRequest object in the
list. |
void |
setPosition(int index)
Sets the current position of the RecordingListIterator. |
void |
toBeginning()
Resets the iterator to the beginning of the list, such that hasPrevious() returns false and
nextEntry() returns the first
RecordingRequest in the list (if the list is not empty). |
void |
toEnd()
Sets the iterator to the end of the list, such that hasNext() returns false and
previousEntry() returns the last
RecordingRequest in the list (if the list is not empty). |
Method Detail |
---|
void toBeginning()
hasPrevious()
returns false
and
nextEntry()
returns the first
RecordingRequest
in the list (if the list is not empty).
void toEnd()
hasNext()
returns false
and
previousEntry()
returns the last
RecordingRequest
in the list (if the list is not empty).
RecordingRequest nextEntry()
RecordingRequest
object in the list.
This method may be called repeatedly to iterate through the list.
RecordingRequest
object at the next
position in the list.
java.util.NoSuchElementException
- If the
iteration has no next RecordingRequest
.RecordingRequest previousEntry()
RecordingRequest
object in the
list. This method may be called repeatedly to iterate through the
list in reverse order.
RecordingRequest
object at the previous
position in the list.
java.util.NoSuchElementException
- If the iteration has no
previous RecordingRequest
.boolean hasNext()
RecordingRequest
in the next
position in the list.
true
if there is a RecordingRequest
in the next position in the list; false
otherwise.boolean hasPrevious()
RecordingRequest
in the previous
position in the list.
true
if there is a RecordingRequest
in the previous position in the list; false
otherwise.RecordingRequest[] nextEntries(int n)
RecordingRequest
objects in the list.
This method also advances the current position within the list. If
the requested number of entries are not available, the remaining
elements are returned. If the current position is at the end
of the iterator, this method returns an array with length zero.
n
- the number of next entries requested.
RecordingRequest
object from the current position in the list. If 'n' is zero
or negative, a zero-length array shall be returned.RecordingRequest[] previousEntries(int n)
RecordingRequest
objects in the
list. This method also changes the current position within the list.
If the requested number of entries are not available, the remaining
elements are returned. If the current position is at the beginning
of the iterator, this method returns an array with length zero.
n
- the number of previous entries requested.
RecordingRequest
object from the current position
in the list. If 'n' is zero
or negative, a zero-length array shall be returned.RecordingRequest getEntry(int index)
RecordingRequest
object at the specified
position. This method does not advance the current position within
the list.
index
- the position of the RecordingRequest to be retrieved.
java.lang.IndexOutOfBoundsException
- if the index is greater than
the size of the list.int getPosition(RecordingRequest entry)
entry
- The recording request for which the position is sought.
int getPosition()
void setPosition(int index) throws java.lang.IndexOutOfBoundsException
index
- the current position of the RecordingListIterator
would be set to this value.
java.lang.IndexOutOfBoundsException
- if the index is greater than
the size of the list.RecordingList getRecordingList()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |