Package jsl.modeling.elements.station
Class ReceiverListIterator
- java.lang.Object
-
- jsl.modeling.elements.station.ReceiverListIterator
-
- All Implemented Interfaces:
ReceiverIteratorIfc
public class ReceiverListIterator extends java.lang.Object implements ReceiverIteratorIfc
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.ListIterator<ReceiveQObjectIfc>
myListIterator
-
Constructor Summary
Constructors Constructor Description ReceiverListIterator(java.util.List<ReceiveQObjectIfc> list)
-
Method Summary
All Methods Instance Methods Concrete 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().
-
-
-
Field Detail
-
myListIterator
protected java.util.ListIterator<ReceiveQObjectIfc> myListIterator
-
-
Constructor Detail
-
ReceiverListIterator
public ReceiverListIterator(java.util.List<ReceiveQObjectIfc> list)
-
-
Method Detail
-
nextReceiver
public ReceiveQObjectIfc nextReceiver()
Description copied from interface:ReceiverIteratorIfc
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.)- Specified by:
nextReceiver
in interfaceReceiverIteratorIfc
- Returns:
- the next receiver or null
-
previousReceiver
public ReceiveQObjectIfc previousReceiver()
Description copied from interface:ReceiverIteratorIfc
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.)- Specified by:
previousReceiver
in interfaceReceiverIteratorIfc
- Returns:
- the previous receiver or null
-
hasNextReceiver
public boolean hasNextReceiver()
Description copied from interface:ReceiverIteratorIfc
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.)- Specified by:
hasNextReceiver
in interfaceReceiverIteratorIfc
- Returns:
- true if there is a next receiver
-
hasPreviousReceiver
public boolean hasPreviousReceiver()
Description copied from interface:ReceiverIteratorIfc
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.)- Specified by:
hasPreviousReceiver
in interfaceReceiverIteratorIfc
- Returns:
- true if there is a previous receiver
-
nextReceiverIndex
public int nextReceiverIndex()
Description copied from interface:ReceiverIteratorIfc
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.)- Specified by:
nextReceiverIndex
in interfaceReceiverIteratorIfc
- 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
public int previousReceiverIndex()
Description copied from interface:ReceiverIteratorIfc
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.)- Specified by:
previousReceiverIndex
in interfaceReceiverIteratorIfc
- 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
-
-