ServiceIterator

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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

    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

    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

    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:
    `NoSuchElementException` - If the iteration has no next `Service`.

### previousService

    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:
    `NoSuchElementException` - If the iteration has no previous `Service`.

### hasNext

    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

    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.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD