org.jmythapi.protocol.response
Interface IProgramInfoFilter

All Superinterfaces:
IFilter<IProgramInfo.Props,IProgramInfo>
All Known Implementing Classes:
ProgramInfoChannelFilter, ProgramInfoChannelIdRecordingStartTimeFilter, ProgramInfoConjunctionFilter, ProgramInfoDisjunctionFilter, ProgramInfoFilter, ProgramInfoNegotiationFilter, ProgramInfoRecorderFilter, ProgramInfoRecordingGroupFilter, ProgramInfoRecordingIdFilter, ProgramInfoStorageGroupFilter, ProgramInfoUniqueIdFilter

public interface IProgramInfoFilter
extends IFilter<IProgramInfo.Props,IProgramInfo>

A program-filter can be used to filter programs from a program-list.

Usage example:

This example shows how you can implement your own filter. The example filter only returns recordings with a duration greater than 60 minutes.

    // get a list of all recordings
    IProgramInfoList allRecordings = backend.queryRecordings();
    
    // define a new duration filter
    IProgramInfoFilter durationFilter = new IProgramInfoFilter() {			
       public boolean accept(IProgramInfo program) {
          return (program.getDuration() > 60);
       }
    };
    
    // filter recordings
    IProgramInfoList filteredRecordings = allRecordings.filter(durationFilter);
    
    // print out all matching recordings				
    for(IProgramInfo program : filteredRecordings) {
       System.out.println(String.format(
          "%s (%d minutes)",
          program.getFullTitle(),
          program.getDuration()
       ));
    }
 
See ProgramInfoFilters for a list of all predefined filters.

See Also:
IRecordings.getProgramInfoList(IProgramInfoFilter), IRecordings.iterator(IProgramInfoFilter), IProgramInfoList.filter(IProgramInfoFilter), IProgramInfoList.groupBy(org.jmythapi.protocol.response.IProgramInfo.Props, IProgramInfoFilter)

Method Summary
 boolean accept(IProgramInfo program)
          Tests if the filter criteria matches onto the given program.
 

Method Detail

accept

boolean accept(IProgramInfo program)
Tests if the filter criteria matches onto the given program.

Specified by:
accept in interface IFilter<IProgramInfo.Props,IProgramInfo>
Parameters:
program - the program that should be tested
Returns:
true if the given program is accepted by the filter


Copyright © 2008-2013. All Rights Reserved.