public interface ServiceList
ServiceList represents an ordered list of
Service objects based on a specific grouping rule
defined by a ServiceFilter. The objects in a
ServiceList are numbered from 0 to size()
-1.
A ServiceList is immutable. In other words,
once a ServiceList instance is created, the elements
in the list and their order will never change. All classes that
implement the ServiceList interface are required to
maintain this property.Service,
ServiceFilter,
size()| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(Service service)
Tests if the indicated
Service object is contained
in the list. |
ServiceIterator |
createServiceIterator()
Generates an iterator on the
Service elements
in this list. |
boolean |
equals(Object o)
Compares the specified object with this
ServiceList
for equality. |
ServiceList |
filterServices(ServiceFilter filter)
Creates a new
ServiceList object that is a subset of
this list, based on the conditions specified by a
ServiceFilter object. |
Service |
findService(Locator locator)
Reports the
Service corresponding to the specified
locator if it is a member of this list. |
Service |
getService(int index)
Reports the
Service at the specified index position. |
int |
hashCode()
Provides the hash code value for this
ServiceList. |
int |
indexOf(Service service)
Reports the position of the first occurrence of the
indicated
Service object in the list. |
int |
size()
Reports the number of
Service objects in the list. |
ServiceList |
sortByName()
Generates a new
ServiceList containing the
same elements as the current list, sorted in ascending
order by service name. |
ServiceList |
sortByNumber()
Generates a new
ServiceList containing the
same elements as the current list, sorted in ascending
order by service number. |
ServiceList sortByName()
ServiceList containing the
same elements as the current list, sorted in ascending
order by service name.ServiceList sorted by service name.Service.getName()ServiceList sortByNumber() throws SortNotAvailableException
ServiceList containing the
same elements as the current list, sorted in ascending
order by service number.ServiceList sorted by service number.SortNotAvailableException - If any of the
Service objects in this ServiceList
do not implement the ServiceNumber interface.ServiceNumberService findService(Locator locator) throws InvalidLocatorException
Service corresponding to the specified
locator if it is a member of this list.locator - Specifies the Service to be searched for.Service corresponding to
locator, or null if the
Service is not a member of this list.InvalidLocatorException - If locator does not
reference a valid Service.ServiceList filterServices(ServiceFilter filter)
ServiceList object that is a subset of
this list, based on the conditions specified by a
ServiceFilter object. This method may be used to
generate increasingly specialized lists of Service
objects based on multiple filtering criteria. If the filter is
null, the resulting ServiceList will be
a duplicate of this list.
Note that the accept method of the given
ServiceFilter will be invoked for each
Service to be filtered using the same application
thread that invokes this method.
filter - A filter constraining the requested service list,
or null.ServiceList object created based on the
specified filtering rules.ServiceFilter.accept(javax.tv.service.Service)ServiceIterator createServiceIterator()
Service elements
in this list.ServiceIterator on the
Services in this list.boolean contains(Service service)
Service object is contained
in the list.service - The Service object for which to search.true if the specified Service
is member of the list; false otherwise.int indexOf(Service service)
Service object in the list.service - The Service object for which to search.service, or -1 if service
is not contained in the list.int size()
Service objects in the list.Service objects in the list.Service getService(int index)
Service at the specified index position.index - A position in the ServiceList.Service at the specified index.IndexOutOfBoundsException - If index < 0 or
index > size()-1.boolean equals(Object o)
ServiceList
for equality. Returns true if and only if the
specified object is also a ServiceList, both lists
have the same size, and all corresponding pairs of elements in
the two lists are equal. (Two elements e1 and e2 are equal if
(e1==null ? e2==null : e1.equals(e2)).) In other words, two lists
are defined to be equal if they contain the same elements in the
same order.Copyright © 2012 code4tv.com. All Rights Reserved.