Use is subject to License Terms. Your use of this web site or any of its content or software indicates your agreement to be bound by these License Terms.

Copyright © 2006 Sun Microsystems, Inc. All rights reserved.

JSR-927 (Maintenance Release)

javax.tv.service.navigation
Interface ServiceIterator


public interface 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.

See Also:
ServiceList

Method Summary
 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 and nextService() returns the first Service 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 previousService() returns the last Service in the list (if the list is not empty).
 

Method Detail

toBeginning

public void toBeginning()
Resets the iterator to the beginning of the list, such that hasPrevious() returns false and nextService() returns the first Service in the list (if the list is not empty).


toEnd

public void toEnd()
Sets the iterator to the end of the list, such that hasNext() returns false and previousService() returns the last Service in the list (if the list is not empty).


nextService

public Service nextService()
Reports the next Service object in the list. This method may be called repeatedly to iterate through the list.

Returns:
The Service object at the next position in the list.
Throws:
java.util.NoSuchElementException - If the iteration has no next Service.

previousService

public Service previousService()
Reports the previous Service object in the list. This method may be called repeatedly to iterate through the list in reverse order.

Returns:
The Service object at the previous position in the list.
Throws:
java.util.NoSuchElementException - If the iteration has no previous Service.

hasNext

public boolean hasNext()
Tests if there is a Service in the next position in the list.

Returns:
true if there is a Service in the next position in the list; false otherwise.

hasPrevious

public boolean hasPrevious()
Tests if there is a Service in the previous position in the list.

Returns:
true if there is a Service in the previous position in the list; false otherwise.

JSR-927 (Maintenance Release)

Copyright © 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to License Terms. Your use of this web site or any of its content or software indicates your agreement to be bound by these License Terms.

For more information, please consult the JSR 927 specification.