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
Class PreferenceFilter

java.lang.Object
  extended byjavax.tv.service.navigation.ServiceFilter
      extended byjavax.tv.service.navigation.PreferenceFilter

public final class PreferenceFilter
extends ServiceFilter

PreferenceFilter represents a ServiceFilter based on a user preference for favorite services. A ServiceList resulting from this filter will include only user favorite services contained in the specified preference.

See Also:
FavoriteServicesName, ServiceList

Constructor Summary
PreferenceFilter(FavoriteServicesName preference)
          Constructs the filter based on a particular user preference for favorite services.
 
Method Summary
 boolean accept(Service service)
          Tests if the given service passes the filter.
 FavoriteServicesName getFilterValue()
          Reports the user preference used to create this filter.
static FavoriteServicesName[] listPreferences()
          Reports the available favorite service preferences that can be used to create this filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreferenceFilter

public PreferenceFilter(FavoriteServicesName preference)
Constructs the filter based on a particular user preference for favorite services.

Parameters:
preference - A named user preference, obtained from the listPreferences() method, representing favorite Services to be included in a resulting service list.
Throws:
java.lang.IllegalArgumentException - If the specified preference is not obtainable from the listPreferences() method.
See Also:
listPreferences()
Method Detail

listPreferences

public static FavoriteServicesName[] listPreferences()
Reports the available favorite service preferences that can be used to create this filter.

Returns:
An array of preferences for favorite services. If none exist or are supported, an empty array is returned.

getFilterValue

public FavoriteServicesName getFilterValue()
Reports the user preference used to create this filter.

Returns:
The user preference representing the favorite services by which the filter was constructed.

accept

public boolean accept(Service service)
Tests if the given service passes the filter.

Specified by:
accept in class ServiceFilter
Parameters:
service - An individual Service to be evaluated against the filtering algorithm.
Returns:
true if service is part of the favorite services indicated by the filter value; 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.