Package jsl.modeling.elements.station
Interface ReceiverIteratorIfc
-
- All Known Implementing Classes:
ReceiverListIterator
public interface ReceiverIteratorIfc
Defines an interface for (list) iterator for ReceiveQObjectIfc implementors. Note that unlike ListIterator null is returned if there is not a next or previous element.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
hasNextReceiver()
Returns true if this list iterator has more elements when traversing the list in the forward direction.boolean
hasPreviousReceiver()
Returns true if this list iterator has more elements when traversing the list in the reverse direction.ReceiveQObjectIfc
nextReceiver()
Returns the next element in the list and advances the cursor position.int
nextReceiverIndex()
Returns the index of the element that would be returned by a subsequent call to nextReceiver().ReceiveQObjectIfc
previousReceiver()
Returns the previous element in the list and moves the cursor position backwards.int
previousReceiverIndex()
Returns the index of the element that would be returned by a subsequent call to previous().
-
-
-
Method Detail
-
nextReceiver
ReceiveQObjectIfc nextReceiver()
Returns the next element in the list and advances the cursor position. This method may be called repeatedly to iterate through the list, or intermixed with calls to previous() to go back and forth. (Note that alternating calls to next and previous will return the same element repeatedly.)- Returns:
- the next receiver or null
-
previousReceiver
ReceiveQObjectIfc previousReceiver()
Returns the previous element in the list and moves the cursor position backwards. This method may be called repeatedly to iterate through the list backwards, or intermixed with calls to next() to go back and forth. (Note that alternating calls to next and previous will return the same element repeatedly.)- Returns:
- the previous receiver or null
-
hasNextReceiver
boolean hasNextReceiver()
Returns true if this list iterator has more elements when traversing the list in the forward direction. (In other words, returns true if next() would return an element rather null.)- Returns:
- true if there is a next receiver
-
hasPreviousReceiver
boolean hasPreviousReceiver()
Returns true if this list iterator has more elements when traversing the list in the reverse direction. (In other words, returns true if previous() would return an element rather than null.)- Returns:
- true if there is a previous receiver
-
nextReceiverIndex
int nextReceiverIndex()
Returns the index of the element that would be returned by a subsequent call to nextReceiver(). (Returns list size if the list iterator is at the end of the list.)- Returns:
- the index of the element that would be returned by a subsequent call to nextReceiver(), or list size if the list iterator is at the end of the list
-
previousReceiverIndex
int previousReceiverIndex()
Returns the index of the element that would be returned by a subsequent call to previous(). (Returns -1 if the list iterator is at the beginning of the list.)- Returns:
- the index of the element that would be returned by a subsequent call to previousReceiver(), or -1 if the list iterator is at the beginning of the list
-
-