- java.lang.Object
-
- tvdataservice.MutableProgram
-
-
Field Summary
Fields Modifier and Type Field Description protected static Marker[]
EMPTY_MARKER_ARR
A plugin array that can be shared by all the programs that are not marked by any plugin.static java.lang.String
ID_DATE_FORMAT
The date format, which is used in the unique IDstatic int
MAX_SHORT_INFO_LENGTH
The maximum length of a short info.protected java.lang.String
mTitle
Contains the title-
Fields inherited from interface devplugin.Program
DEFAULT_PROGRAM_IMPORTANCE, HIGHER_MEDIUM_MARK_PRIORITY, HIGHER_MEDIUM_PROGRAM_IMPORTANCE, IMPORTANCE_PROGRAM_DEFAULT, IMPORTANCE_PROGRAM_MAX, IMPORTANCE_PROGRAM_MEDIUM, IMPORTANCE_PROGRAM_MEDIUM_HIGHER, IMPORTANCE_PROGRAM_MEDIUM_LOWER, IMPORTANCE_PROGRAM_MIN, INFO_AUDIO_DESCRIPTION, INFO_AUDIO_DOLBY_DIGITAL_5_1, INFO_AUDIO_DOLBY_SURROUND, INFO_AUDIO_MONO, INFO_AUDIO_STEREO, INFO_AUDIO_TWO_CHANNEL_TONE, INFO_CATEGORIE_ARTS, INFO_CATEGORIE_CHILDRENS, INFO_CATEGORIE_DOCUMENTARY, INFO_CATEGORIE_MAGAZINE_INFOTAINMENT, INFO_CATEGORIE_MOVIE, INFO_CATEGORIE_NEWS, INFO_CATEGORIE_OTHERS, INFO_CATEGORIE_SERIES, INFO_CATEGORIE_SHOW, INFO_CATEGORIE_SPORTS, INFO_LIVE, INFO_NEW, INFO_NONE, INFO_ORIGINAL_WITH_SUBTITLE, INFO_SIGN_LANGUAGE, INFO_SUBTITLE_FOR_AURALLY_HANDICAPPED, INFO_VISION_16_TO_9, INFO_VISION_4_TO_3, INFO_VISION_BLACK_AND_WHITE, INFO_VISION_HD, IS_VALID_STATE, LOWER_MEDIUM_MARK_PRIORITY, LOWER_MEDIUM_PROGRAM_IMPORTANCE, MARK_PRIORITY, MAX_MARK_PRIORITY, MAX_PROGRAM_IMPORTANCE, MEDIUM_MARK_PRIORITY, MEDIUM_PROGRAM_IMPORTANCE, MIN_MARK_PRIORITY, MIN_PROGRAM_IMPORTANCE, NO_MARK_PRIORITY, PRIORITY_MARK_MAX, PRIORITY_MARK_MEDIUM, PRIORITY_MARK_MEDIUM_HIGHER, PRIORITY_MARK_MEDIUM_LOWER, PRIORITY_MARK_MIN, PRIORITY_MARK_NONE, STATE_IS_VALID, STATE_WAS_DELETED, STATE_WAS_UPDATED, WAS_DELETED_STATE, WAS_UPDATED_STATE
-
-
Constructor Summary
Constructors Constructor Description MutableProgram(Channel channel, Date localDate, boolean isLoading)
Creates a new instance of MutableProgram.MutableProgram(Channel channel, Date localDate, int localHours, int localMinutes, boolean isLoading)
Creates a new instance of MutableProgram.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addChangeListener(javax.swing.event.ChangeListener listener)
Adds a ChangeListener to the program.boolean
equals(java.lang.Object o)
boolean
equalsAllFields(MutableProgram program)
check if two programs are identical by their field contentsprotected void
fireStateChanged()
Send a ChangeEvent, whose source is this program, to each listener.static java.lang.String
generateShortInfoFromDescription(java.lang.String shortInfo)
Trim text for shortinfo-fieldbyte[]
getBinaryField(ProgramFieldType type)
Gets the value of a binary field from the program.Channel
getChannel()
Returns the channel object of this program.Date
getDate()
Returns the date of this program.java.lang.String
getDateString()
get the date of this program as nicely formatted stringjava.lang.String
getDescription()
Returns a description about the program.java.lang.String
getEndTimeString()
get the end time of this program as nicely formatted stringint
getFieldCount()
Gets the number of fields this program has.java.util.Iterator<ProgramFieldType>
getFieldIterator()
Gets an iterator over the types of all fields this program has.int
getHours()
Gets the hour-component of the start time of the program.java.lang.String
getID()
Gets the ID of this program.int
getInfo()
Returns additional information of the program (or zero).int
getIntField(ProgramFieldType type)
Gets the value of a int field from the program.java.lang.String
getIntFieldAsString(ProgramFieldType type)
Gets the value of a int field as String.int
getLength()
Gets the length of this program in minutes.Date
getLocalDate()
int
getLocalStartTime()
Marker[]
getMarkerArr()
Gets allMarker
s that have marked this program.java.lang.Integer[]
getMarkPriorities()
Gets an array of all marking priorities of this program.int
getMarkPriority()
Deprecated.since 4.2.2int
getMarkPriorityMax()
Gets the priority of the marking of this program.int
getMinutes()
Gets the minute-component of the start time of the program.protected java.lang.Object
getObjectValueField(ProgramFieldType type)
access method to object field values. this allows ondemand programs to reimplement the accessint
getProgramState()
Returns the state of this program.java.lang.String
getShortInfo()
Returns a short information about the program (about three lines).int
getStartTime()
Gets the the start time of the program in minutes after midnight.java.lang.String
getTextField(ProgramFieldType type)
Gets the value of a text field from the program.int
getTimeField(ProgramFieldType type)
Gets the value of a time field from the program.java.lang.String
getTimeFieldAsString(ProgramFieldType type)
Gets the value of a time field as String of the pattern "h:mm".java.lang.String
getTimeString()
get the start time of this program as nicely formatted stringjava.lang.String
getTitle()
Returns the title of this program.java.lang.String
getUniqueID()
Gets the unique ID of this program.boolean
hasFieldValue(ProgramFieldType type)
checks if the given field has a non-null
value. use this method if you don't need the value of the field, but only the knowledge about existenceint
hashCode()
boolean
isExpired()
Gets whether this program is expired.boolean
isOnAir()
Gets whether this program is marked as "on air".void
mark(Marker marker)
Marks the program for a plugin.void
mark(Plugin javaPlugin)
Marks the program for a Java plugin.void
removeChangeListener(javax.swing.event.ChangeListener listener)
Removes a ChangeListener from the program.void
setBinaryField(ProgramFieldType type, byte[] value)
Set a binary field.void
setDescription(java.lang.String description)
Sets a description about the program.void
setInfo(int info)
Sets additional information of the program (or zero).void
setIntField(ProgramFieldType type, int value)
Set an int field.void
setLength(int length)
Sets the length of this program in minutes.protected void
setObjectValueField(ProgramFieldType type, java.lang.Object value)
void
setProgramLoadingIsComplete()
Sets the loading state to false.protected void
setProgramState(int state)
Sets the state of this program to a program state.void
setShortInfo(java.lang.String shortInfo)
Sets a short information about the program (about three lines).void
setTextField(ProgramFieldType type, java.lang.String inValue)
Set a text field.void
setTimeField(ProgramFieldType type, int value)
Set a time field.void
setTitle(java.lang.String title)
Sets the title of this program.java.lang.String
toString()
Gets a String representation of this program for debugging.void
unmark(Marker marker)
Removes the marks from the program for a plugin.void
unmark(Plugin javaPlugin)
Removes the marks from the program for a Java plugin.void
validateMarking()
Informs the ChangeListeners for repainting if a Plugin uses more than one Icon for the Program.
-
-
-
Field Detail
-
MAX_SHORT_INFO_LENGTH
public static final int MAX_SHORT_INFO_LENGTH
The maximum length of a short info. Used for generating a short info out of a (long) description.- See Also:
- Constant Field Values
-
EMPTY_MARKER_ARR
protected static final Marker[] EMPTY_MARKER_ARR
A plugin array that can be shared by all the programs that are not marked by any plugin.
-
ID_DATE_FORMAT
public static final java.lang.String ID_DATE_FORMAT
The date format, which is used in the unique ID- See Also:
- Constant Field Values
-
mTitle
protected java.lang.String mTitle
Contains the title
-
-
Constructor Detail
-
MutableProgram
public MutableProgram(Channel channel, Date localDate, int localHours, int localMinutes, boolean isLoading)
Creates a new instance of MutableProgram.The parameters channel, date, hours and minutes build the ID. That's why they are not mutable.
- Parameters:
channel
- The channel object of this program.localDate
- The date of this program.localHours
- The hour-component of the start time of the program.localMinutes
- The minute-component of the start time of the program.isLoading
- If the program is currently being created.- See Also:
setProgramLoadingIsComplete()
-
MutableProgram
public MutableProgram(Channel channel, Date localDate, boolean isLoading)
Creates a new instance of MutableProgram.The parameters channel, date, hours and minutes build the ID. That's why they are not mutable.
- Parameters:
channel
- The channel object of this program.localDate
- The date of this program.isLoading
- If the program is currently loading.- See Also:
setProgramLoadingIsComplete()
-
-
Method Detail
-
addChangeListener
public void addChangeListener(javax.swing.event.ChangeListener listener)
Adds a ChangeListener to the program.- Specified by:
addChangeListener
in interfaceProgram
- Parameters:
listener
- the ChangeListener to add- See Also:
fireStateChanged()
,removeChangeListener(javax.swing.event.ChangeListener)
-
removeChangeListener
public void removeChangeListener(javax.swing.event.ChangeListener listener)
Removes a ChangeListener from the program.- Specified by:
removeChangeListener
in interfaceProgram
- Parameters:
listener
- the ChangeListener to remove- See Also:
fireStateChanged()
,addChangeListener(javax.swing.event.ChangeListener)
-
fireStateChanged
protected void fireStateChanged()
Send a ChangeEvent, whose source is this program, to each listener.- See Also:
addChangeListener(javax.swing.event.ChangeListener)
,EventListenerList
-
getTimeString
public final java.lang.String getTimeString()
Description copied from interface:Program
get the start time of this program as nicely formatted string- Specified by:
getTimeString
in interfaceProgram
- Returns:
- the start time string
-
getEndTimeString
public final java.lang.String getEndTimeString()
Description copied from interface:Program
get the end time of this program as nicely formatted string- Specified by:
getEndTimeString
in interfaceProgram
- Returns:
- the end time string
-
getDateString
public final java.lang.String getDateString()
Description copied from interface:Program
get the date of this program as nicely formatted string- Specified by:
getDateString
in interfaceProgram
- Returns:
- the date string
-
isOnAir
public boolean isOnAir()
Gets whether this program is marked as "on air".
-
mark
public final void mark(Plugin javaPlugin)
Marks the program for a Java plugin.
-
unmark
public final void unmark(Plugin javaPlugin)
Removes the marks from the program for a Java plugin.If the program wasn't marked for the plugin, nothing happens.
-
mark
public final void mark(Marker marker)
Marks the program for a plugin.
-
unmark
public final void unmark(Marker marker)
Removes the marks from the program for a plugin.If the program wasn't marked for the plugin, nothing happens.
-
getMarkerArr
public Marker[] getMarkerArr()
Description copied from interface:Program
Gets allMarker
s that have marked this program.- Specified by:
getMarkerArr
in interfaceProgram
- Returns:
- An array with all Marker that have marked this program.
-
isExpired
public boolean isExpired()
Gets whether this program is expired.
-
getID
public java.lang.String getID()
Gets the ID of this program. This ID is unique for a certain date.
-
getUniqueID
public java.lang.String getUniqueID()
Gets the unique ID of this program. In contrast to getID() this method returns an ID, which is unique for all programs. This value becomes invalid when changing the application time zone.- Specified by:
getUniqueID
in interfaceProgram
- Returns:
- An unique ID of this program.
-
getBinaryField
public byte[] getBinaryField(ProgramFieldType type)
Description copied from interface:Program
Gets the value of a binary field from the program.- Specified by:
getBinaryField
in interfaceProgram
- Parameters:
type
- The type of the wanted field. Must have a binary format.- Returns:
- The value of the field or
null
, if there is no value for this field.
-
getTextField
public java.lang.String getTextField(ProgramFieldType type)
Description copied from interface:Program
Gets the value of a text field from the program.- Specified by:
getTextField
in interfaceProgram
- Parameters:
type
- The type of the wanted field. Must have a text format.- Returns:
- The value of the field or
null
, if there is no value for this field.
-
getObjectValueField
protected java.lang.Object getObjectValueField(ProgramFieldType type)
access method to object field values. this allows ondemand programs to reimplement the access- Parameters:
type
- The program file type to get the value for.- Returns:
- object stored in the field
-
getIntField
public int getIntField(ProgramFieldType type)
Description copied from interface:Program
Gets the value of a int field from the program.- Specified by:
getIntField
in interfaceProgram
- Parameters:
type
- The type of the wanted field. Must have a int format.- Returns:
- The value of the field or
-1
, if there is no value for this field.
-
getIntFieldAsString
public java.lang.String getIntFieldAsString(ProgramFieldType type)
Gets the value of a int field as String.- Specified by:
getIntFieldAsString
in interfaceProgram
- Parameters:
type
- The type of the wanted field. Must have a int format.- Returns:
- The value of the field as String or
null
, if there is no value for this field.
-
getTimeField
public int getTimeField(ProgramFieldType type)
Description copied from interface:Program
Gets the value of a time field from the program.- Specified by:
getTimeField
in interfaceProgram
- Parameters:
type
- The type of the wanted field. Must have a time format.- Returns:
- The value of the field or
-1
, if there is no value for this field.
-
getTimeFieldAsString
public java.lang.String getTimeFieldAsString(ProgramFieldType type)
Gets the value of a time field as String of the pattern "h:mm".- Specified by:
getTimeFieldAsString
in interfaceProgram
- Parameters:
type
- The type of the wanted field. Must have a time format.- Returns:
- The value of the field as String or
null
, if there is no value for this field.
-
getFieldCount
public int getFieldCount()
Gets the number of fields this program has.- Specified by:
getFieldCount
in interfaceProgram
- Returns:
- the number of fields this program has.
-
getFieldIterator
public java.util.Iterator<ProgramFieldType> getFieldIterator()
Gets an iterator over the types of all fields this program has.- Specified by:
getFieldIterator
in interfaceProgram
- Returns:
- an iterator over
ProgramFieldType
s.
-
setBinaryField
public void setBinaryField(ProgramFieldType type, byte[] value)
Set a binary field.- Parameters:
type
- The type of the field.value
- The binary value to set.
-
setObjectValueField
protected void setObjectValueField(ProgramFieldType type, java.lang.Object value)
-
setTextField
public void setTextField(ProgramFieldType type, java.lang.String inValue)
Set a text field.- Parameters:
type
- The type of the field.inValue
- The text value to set.
-
setIntField
public void setIntField(ProgramFieldType type, int value)
Set an int field.- Parameters:
type
- The type of the field.value
- The int value to set.
-
setTimeField
public void setTimeField(ProgramFieldType type, int value)
Set a time field.- Parameters:
type
- The type of the field.value
- The time value to set.
-
generateShortInfoFromDescription
public static java.lang.String generateShortInfoFromDescription(java.lang.String shortInfo)
Trim text for shortinfo-field- Parameters:
shortInfo
- generate Text from this field- Returns:
- Text that fits into shortInfo
- Since:
- 2.7
-
setTitle
public void setTitle(java.lang.String title)
Sets the title of this program.- Parameters:
title
- the new title of this program.
-
getTitle
public java.lang.String getTitle()
Returns the title of this program.
-
setShortInfo
public void setShortInfo(java.lang.String shortInfo)
Sets a short information about the program (about three lines). May be null.If the length of the short info exceeds 100 characters it will be cut using a smart algorithm.
- Parameters:
shortInfo
- The new short info.
-
getShortInfo
public java.lang.String getShortInfo()
Returns a short information about the program (about three lines). May be null.- Specified by:
getShortInfo
in interfaceProgram
- Returns:
- The short info.
-
setDescription
public void setDescription(java.lang.String description)
Sets a description about the program. May be null.- Parameters:
description
- The description.
-
getDescription
public java.lang.String getDescription()
Returns a description about the program. May be null.- Specified by:
getDescription
in interfaceProgram
- Returns:
- The description.
-
getStartTime
public int getStartTime()
Gets the the start time of the program in minutes after midnight.- Specified by:
getStartTime
in interfaceProgram
- Returns:
- the start time.
-
getHours
public int getHours()
Gets the hour-component of the start time of the program.
-
getMinutes
public int getMinutes()
Gets the minute-component of the start time of the program.- Specified by:
getMinutes
in interfaceProgram
- Returns:
- the minute-component of the start time.
-
getLocalStartTime
public int getLocalStartTime()
- Returns:
- The local start time.
-
setLength
public void setLength(int length)
Sets the length of this program in minutes.- Parameters:
length
- the new length.
-
getLength
public int getLength()
Description copied from interface:Program
Gets the length of this program in minutes.
-
setInfo
public void setInfo(int info)
Sets additional information of the program (or zero).- Parameters:
info
- The new additional information.
-
getInfo
public int getInfo()
Returns additional information of the program (or zero).
-
getChannel
public Channel getChannel()
Returns the channel object of this program.- Specified by:
getChannel
in interfaceProgram
- Returns:
- The channel.
-
getDate
public Date getDate()
Returns the date of this program.
-
getLocalDate
public Date getLocalDate()
- Returns:
- The local date
-
toString
public java.lang.String toString()
Gets a String representation of this program for debugging.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A String representation for debugging.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equalsAllFields
public boolean equalsAllFields(MutableProgram program)
check if two programs are identical by their field contents- Parameters:
program
- The program to check.- Returns:
true
, if all fields are equal- Since:
- 2.6
-
setProgramState
protected void setProgramState(int state)
Sets the state of this program to a program state.- Parameters:
state
- The state of this program.- Since:
- 2.2
-
getProgramState
public int getProgramState()
Returns the state of this program.- Specified by:
getProgramState
in interfaceProgram
- Returns:
- The program state.
- Since:
- 2.2
-
validateMarking
public final void validateMarking()
Informs the ChangeListeners for repainting if a Plugin uses more than one Icon for the Program.- Specified by:
validateMarking
in interfaceProgram
- Since:
- 2.2.2
- See Also:
Plugin.getMarkIconsForProgram(Program)
-
setProgramLoadingIsComplete
public void setProgramLoadingIsComplete()
Sets the loading state to false. Call this after creation of the program from the data service.- Since:
- 2.2.2
-
getMarkPriority
@Deprecated(since="4.2.2") public int getMarkPriority()
Deprecated.since 4.2.2Gets the priority of the marking of this program.- Specified by:
getMarkPriority
in interfaceProgram
- Returns:
- The mark priority.
- Since:
- 2.5.1
-
getMarkPriorityMax
public int getMarkPriorityMax()
Gets the priority of the marking of this program.- Specified by:
getMarkPriorityMax
in interfaceProgram
- Returns:
- The mark priority.
- Since:
- 4.2.2
-
getMarkPriorities
public java.lang.Integer[] getMarkPriorities()
Gets an array of all marking priorities of this program.- Specified by:
getMarkPriorities
in interfaceProgram
- Returns:
- An array with all marking priorities of this program.
- Since:
- 4.2.2
-
hasFieldValue
public boolean hasFieldValue(ProgramFieldType type)
Description copied from interface:Program
checks if the given field has a non-null
value. use this method if you don't need the value of the field, but only the knowledge about existence- Specified by:
hasFieldValue
in interfaceProgram
- Parameters:
type
- field type- Returns:
- field is set
-
-