public class ServiceListImpl extends Object implements ServiceList
| Constructor and Description |
|---|
ServiceListImpl(Service[] list) |
ServiceListImpl(Vector list) |
| 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
Services 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()
This method performs a
toBeginning operation on the
iterator. |
ServiceList |
sortByNumber()
Sorts the contents of the list by service number, in ascending
order.
|
public ServiceListImpl(Service[] list)
public ServiceListImpl(Vector list)
public ServiceList sortByName()
toBeginning operation on the
iterator.sortByName in interface ServiceListServiceList sorted by service name.Service.getName()public ServiceList sortByNumber() throws SortNotAvailableException
sortByNumber in interface ServiceListServiceList sorted by service number.SortNotAvailableException - If the contents cannot be
sorted by service number.
If this method is successful, it performs a
toBeginning operation on the iterator.ServiceIterator.toBeginning()public Service findService(Locator locator) throws InvalidLocatorException
findService in interface ServiceListlocator - 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.public 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 createServiceList.
filterServices in interface ServiceListfilter - A filter constraining the requested service list,
or null.ServiceList object created based on the
specified filtering rules.ServiceFilter.accept(javax.tv.service.Service)public ServiceIterator createServiceIterator()
Services in this list.createServiceIterator in interface ServiceListServices in this list.public boolean contains(Service service)
Service object is contained
in the list.contains in interface ServiceListservice - The Service object for which to search.true if the specified Service
is member of the list; false otherwise.public int indexOf(Service service)
Service object in the list.indexOf in interface ServiceListservice - The Service object for which to search.-1 if service is not contained in the list.public int size()
Service objects in the list.size in interface ServiceListService objects in the list.public Service getService(int index)
getService in interface ServiceListindex - A position in the ServiceList.IndexOutOfBoundsException - If index &< 0 or
index &> size()-1.public 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.equals in interface ServiceListequals in class Objecto - The object to be compared for equality with this list.true if the specified object is equal to
this list; false otherwise.public int hashCode()
ServiceList.
Two ServiceList objects that are equal will have
the same hash code.hashCode in interface ServiceListhashCode in class ObjectServiceList.Copyright © 2012 code4tv.com. All Rights Reserved.