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 booleanhasNextReceiver()Returns true if this list iterator has more elements when traversing the list in the forward direction.booleanhasPreviousReceiver()Returns true if this list iterator has more elements when traversing the list in the reverse direction.ReceiveQObjectIfcnextReceiver()Returns the next element in the list and advances the cursor position.intnextReceiverIndex()Returns the index of the element that would be returned by a subsequent call to nextReceiver().ReceiveQObjectIfcpreviousReceiver()Returns the previous element in the list and moves the cursor position backwards.intpreviousReceiverIndex()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:ReceiverIteratorIfcReturns 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:
nextReceiverin interfaceReceiverIteratorIfc- Returns:
- the next receiver or null
-
previousReceiver
public ReceiveQObjectIfc previousReceiver()
Description copied from interface:ReceiverIteratorIfcReturns 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:
previousReceiverin interfaceReceiverIteratorIfc- Returns:
- the previous receiver or null
-
hasNextReceiver
public boolean hasNextReceiver()
Description copied from interface:ReceiverIteratorIfcReturns 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:
hasNextReceiverin interfaceReceiverIteratorIfc- Returns:
- true if there is a next receiver
-
hasPreviousReceiver
public boolean hasPreviousReceiver()
Description copied from interface:ReceiverIteratorIfcReturns 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:
hasPreviousReceiverin interfaceReceiverIteratorIfc- Returns:
- true if there is a previous receiver
-
nextReceiverIndex
public int nextReceiverIndex()
Description copied from interface:ReceiverIteratorIfcReturns 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:
nextReceiverIndexin 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:ReceiverIteratorIfcReturns 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:
previousReceiverIndexin 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
-
-