public class MutableChannelDayProgram extends Object implements ChannelDayProgram
This implementation is mutable, meaning you can add programs. These programs are automatically sorted by time.
Constructor and Description |
---|
MutableChannelDayProgram(Date date,
Channel channel)
Creates a new instance of MutableChannelDayProgram.
|
Modifier and Type | Method and Description |
---|---|
void |
addProgram(Program program)
Adds a program.
|
boolean |
equals(ChannelDayProgram dayProgram)
Compare with the given dayProgram
|
boolean |
getAndResetChangedByPluginState()
Get if the day program was changed by a
plugin and reset the changed state.
|
Channel |
getChannel()
Returns the channel of this day program.
|
Date |
getDate()
Returns the date of this day program.
|
boolean |
getLastProgramHadEndOnUpdate()
Gets the last program end time state on data update.
|
Program |
getProgram(String progID)
Returns the program object having the specified ID.
|
Program |
getProgramAt(int index)
Returns the program at the specified index.
|
int |
getProgramCount()
Gets the number of programs in this list.
|
Iterator<Program> |
getPrograms()
Returns an iterator containing all programs.
|
boolean |
isComplete()
Returns whether this channel day program is complete.
|
void |
removeAllPrograms()
Removes all programs from this day program.
|
void |
setLastProgramHadEndOnUpdate(boolean value)
Sets the last program end time state on data update.
|
void |
setWasChangedByPlugin()
Sets the changed state to let the day program
be saved again to take over the changes.
|
public Channel getChannel()
getChannel
in interface ChannelDayProgram
public Date getDate()
getDate
in interface ChannelDayProgram
public Program getProgram(String progID)
getProgram
in interface ChannelDayProgram
progID
- The ID of the wanted program.public int getProgramCount()
getProgramCount
in interface ChannelDayProgram
public Program getProgramAt(int index)
getProgramAt
in interface ChannelDayProgram
index
- The index of the wanted program.public void addProgram(Program program)
program
- The program to add. This program will automatically be put
in the right position in the list, so the list stays ordered.public void removeAllPrograms()
public Iterator<Program> getPrograms()
getPrograms
in interface ChannelDayProgram
public boolean isComplete()
Return true if the last program ends after midnight. Future implementations may check for gaps too.
isComplete
in interface ChannelDayProgram
public void setLastProgramHadEndOnUpdate(boolean value)
value
- the last program end time on data updatepublic boolean getLastProgramHadEndOnUpdate()
getLastProgramHadEndOnUpdate
in interface ChannelDayProgram
public void setWasChangedByPlugin()
public boolean getAndResetChangedByPluginState()
public boolean equals(ChannelDayProgram dayProgram)
dayProgram
- true
, if all programs of the day match (with each field)TV-Browser 2.7.6, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)