public class ServiceIteratorImpl extends Object implements ServiceIterator
ServiceIterator permits iteration over an ordered
list of Service objects. Applications may use the
ServiceIterator interface to browse a
ServiceList forward or backward.
Upon initial usage, hasPrevious() will return
false and nextService() will return the
first Service in the list, if present.
ServiceList| Constructor and Description |
|---|
ServiceIteratorImpl(Vector list) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext()
Tests if there is a
Service in the next position in
the list. |
boolean |
hasPrevious()
Tests if there is a
Service in the previous
position in the list. |
Service |
nextService()
Reports the next
Service object in the list. |
Service |
previousService()
Reports the previous
Service object in the list. |
void |
toBeginning()
Resets the iterator to the beginning of the list, such that
hasPrevious returns false. |
void |
toEnd()
Sets the iterator to the end of the list, such that
hasNext returns false. |
public ServiceIteratorImpl(Vector list)
public void toBeginning()
hasPrevious returns false.toBeginning in interface ServiceIteratorpublic void toEnd()
hasNext returns false.toEnd in interface ServiceIteratorpublic Service nextService()
Service object in the list. This
method may be called repeatedly to iterate through the list.nextService in interface ServiceIteratorService object at the next position in
the list.NoSuchElementException - If the iteration has no next
Service.public Service previousService()
Service object in the list.
This method may be called repeatedly to iterate through the list
in reverse order.previousService in interface ServiceIteratorService object at the previous position
in the list.NoSuchElementException - If the iteration has no previous
Service.public boolean hasNext()
Service in the next position in
the list.hasNext in interface ServiceIteratortrue if there is a Service in
the next position in the list; false otherwise.public boolean hasPrevious()
Service in the previous
position in the list.hasPrevious in interface ServiceIteratortrue if there is a Service in
the previous position in the list; false otherwise.Copyright © 2012 code4tv.com. All Rights Reserved.