org.jmythapi.protocol.response
Interface IRecordings

All Superinterfaces:
Iterable<IProgramInfo>, IVersionable
All Known Subinterfaces:
IRecordingsConflicting, IRecordingsExpiring, IRecordingsPending, IRecordingsScheduled
All Known Implementing Classes:
ARecordings, RecordingsConflicting, RecordingsExpiring, RecordingsPending, RecordingsScheduled

public interface IRecordings
extends IVersionable, Iterable<IProgramInfo>

A list of recordings.

This interface represents a list of recordings


Method Summary
 IProgramInfoList getProgramInfoList()
          Gets a list of contained recordings.
 IProgramInfoList getProgramInfoList(IProgramInfoFilter filter)
          Gets the list of contained recordings.
 boolean isEmpty()
          Checks if the recordings-list contains a recording.
 Iterator<IProgramInfo> iterator()
          Gets an iterator to loop through all available recordings.
 Iterator<IProgramInfo> iterator(IProgramInfoFilter filter)
          Gets an iterator to loop through all recordings matching the given filter.
 int size()
          Gets the amount of recordings contained in the list.
 
Methods inherited from interface org.jmythapi.IVersionable
getVersionNr
 

Method Detail

getProgramInfoList

IProgramInfoList getProgramInfoList()
Gets a list of contained recordings.

Returns:
the list of contained recordings

getProgramInfoList

IProgramInfoList getProgramInfoList(IProgramInfoFilter filter)
Gets the list of contained recordings. Only recordings matching the given filter will be returned.

Usage example:


In the example listed below we fetch all pending recordings, but only list recordings having the status WILL_RECORD.

 // query pending recordings
 IRecordingsPending pendingRecords = backend.queryAllPending();
 
 // creating the program filter
 IProgramInfoFilter filter = ProgramInfoFilters.recordingStatus(IProgramRecordingStatus.Status.WILL_RECORD);
 
 // loop through the filtered list
 for (IProgramInfo program : pendingRecords.getProgramInfoList(filter)) {
    System.out.println(String.format(
       "%1$tF %1$tT- %2$s (%3$s)",
       program.getStartTime(),
       program.getTitle(),
       program.getChannelSign()
    ));
 }
  

This function internally uses IProgramInfoList.filter(IProgramInfoFilter) to filter the programs.

Parameters:
filter - the filter that should be applied, or null if no filtering should be done.
Returns:
a new list containing the filtered programs

iterator

Iterator<IProgramInfo> iterator()
Gets an iterator to loop through all available recordings.

Specified by:
iterator in interface Iterable<IProgramInfo>
Returns:
a recordings iterator
See Also:
Iterable.iterator()

iterator

Iterator<IProgramInfo> iterator(IProgramInfoFilter filter)
Gets an iterator to loop through all recordings matching the given filter.

Parameters:
filter - the filter that should be applied or null if no filtering should be done.
Returns:
all recordings matching the given filter

size

int size()
Gets the amount of recordings contained in the list.

Returns:
the recording-list size

isEmpty

boolean isEmpty()
Checks if the recordings-list contains a recording.

Returns:
false if there is at least one recording


Copyright © 2008-2013. All Rights Reserved.