|
TV-Browser 2.7.5 API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecttvdataservice.MutableProgram
public class MutableProgram
One program. Consists of the Channel, the time, the title and some extra information.
| Field Summary | |
|---|---|
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 int |
MAX_SHORT_INFO_LENGTH
The maximum length of a short info. |
protected String |
mTitle
Contains the title |
| Constructor Summary | |
|---|---|
MutableProgram(Channel channel,
Date localDate,
boolean isLoading)
Creates a new instance of MutableProgram. |
|
MutableProgram(Channel channel,
Date localDate,
int localHours,
int localMinutes)
Deprecated. Since 2.2.2. Use MutableProgram(Channel, devplugin.Date, int, int, boolean) instead. |
|
MutableProgram(Channel channel,
Date localDate,
int localHours,
int localMinutes,
boolean isLoading)
Creates a new instance of MutableProgram. |
|
| Method Summary | |
|---|---|
void |
addChangeListener(ChangeListener listener)
Adds a ChangeListener to the program. |
boolean |
equals(Object o)
|
boolean |
equalsAllFields(MutableProgram program)
check if two programs are identical by their field contents |
protected void |
fireStateChanged()
Send a ChangeEvent, whose source is this program, to each listener. |
static String |
generateShortInfoFromDescription(String shortInfo)
Trimm text for shortinfo-field |
byte[] |
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. |
String |
getDateString()
get the date of this program as nicely formatted string |
String |
getDescription()
Returns a description about the program. |
String |
getEndTimeString()
get the end time of this program as nicely formatted string |
protected Object |
getField(ProgramFieldType type,
int fieldFormat)
|
int |
getFieldCount()
Gets the number of fields this program has. |
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. |
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. |
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()
|
PluginAccess[] |
getMarkedByPlugins()
Deprecated. use getMarkerArr() |
Marker[] |
getMarkerArr()
Gets all Markers that have marked this program. |
int |
getMarkPriority()
Gets the priority of the marking of this program. |
int |
getMinutes()
Gets the minute-component of the start time of the program. |
int |
getProgramState()
Returns the state of this program. |
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. |
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. |
String |
getTimeFieldAsString(ProgramFieldType type)
Gets the value of a time field as String of the pattern "h:mm". |
String |
getTimeString()
get the start time of this program as nicely formatted string |
String |
getTitle()
Returns the title of this program. |
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(ChangeListener listener)
Removes a ChangeListener from the program. |
void |
setBinaryField(ProgramFieldType type,
byte[] value)
Set a binary field. |
void |
setDescription(String description)
Sets a description about the program. |
protected void |
setField(ProgramFieldType type,
int fieldFormat,
Object value)
|
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 |
setMarkerArr(Marker[] marker)
Sets the marker array of this program. |
protected void |
setMarkPriority(int markPriority)
Sets the mark priority for this program |
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(String shortInfo)
Sets a short information about the program (about three lines). |
void |
setTextField(ProgramFieldType type,
String value)
Set a text field. |
void |
setTimeField(ProgramFieldType type,
int value)
Set a time field. |
void |
setTitle(String title)
Sets the title of this program. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int MAX_SHORT_INFO_LENGTH
protected static final Marker[] EMPTY_MARKER_ARR
protected String mTitle
| Constructor Detail |
|---|
public MutableProgram(Channel channel,
Date localDate,
int localHours,
int localMinutes)
MutableProgram(Channel, devplugin.Date, int, int, boolean) instead.
The parameters channel, date, hours and minutes build the ID. That's why they are not mutable.
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.
public MutableProgram(Channel channel,
Date localDate,
int localHours,
int localMinutes,
boolean isLoading)
The parameters channel, date, hours and minutes build the ID. That's why they are not mutable.
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 curently being created.setProgramLoadingIsComplete()
public MutableProgram(Channel channel,
Date localDate,
boolean isLoading)
The parameters channel, date, hours and minutes build the ID. That's why they are not mutable.
channel - The channel object of this program.localDate - The date of this program.isLoading - If the program is curently loading.setProgramLoadingIsComplete()| Method Detail |
|---|
public void addChangeListener(ChangeListener listener)
addChangeListener in interface Programlistener - the ChangeListener to addfireStateChanged(),
removeChangeListener(javax.swing.event.ChangeListener)public void removeChangeListener(ChangeListener listener)
removeChangeListener in interface Programlistener - the ChangeListener to removefireStateChanged(),
addChangeListener(javax.swing.event.ChangeListener)protected void fireStateChanged()
addChangeListener(javax.swing.event.ChangeListener),
EventListenerListpublic final String getTimeString()
Program
getTimeString in interface Programpublic final String getEndTimeString()
Program
getEndTimeString in interface Programpublic final String getDateString()
Program
getDateString in interface Programpublic boolean isOnAir()
isOnAir in interface Programpublic final void mark(Plugin javaPlugin)
mark in interface ProgramjavaPlugin - The plugin to mark the program for.public final void unmark(Plugin javaPlugin)
If the program wasn't marked for the plugin, nothing happens.
unmark in interface ProgramjavaPlugin - The plugin to remove the mark for.public final void mark(Marker marker)
mark in interface Programmarker - The plugin to mark the program for.public final void unmark(Marker marker)
If the program wasn't marked for the plugin, nothing happens.
unmark in interface Programmarker - The plugin to remove the mark for.public PluginAccess[] getMarkedByPlugins()
getMarkerArr()
Plugins that have marked this program.
getMarkedByPlugins in interface Programpublic Marker[] getMarkerArr()
ProgramMarkers that have marked this program.
getMarkerArr in interface Programpublic boolean isExpired()
isExpired in interface Programpublic String getID()
getID in interface Programpublic byte[] getBinaryField(ProgramFieldType type)
Program
getBinaryField in interface Programtype - The type of the wanted field. Must have a binary format.
null, if there is no
value for this field.public String getTextField(ProgramFieldType type)
Program
getTextField in interface Programtype - The type of the wanted field. Must have a text format.
null, if there is no
value for this field.public int getIntField(ProgramFieldType type)
Program
getIntField in interface Programtype - The type of the wanted field. Must have a int format.
-1, if there is no
value for this field.public String getIntFieldAsString(ProgramFieldType type)
getIntFieldAsString in interface Programtype - The type of the wanted field. Must have a int format.
null, if there is
no value for this field.public int getTimeField(ProgramFieldType type)
Program
getTimeField in interface Programtype - The type of the wanted field. Must have a time format.
-1, if there is no
value for this field.public String getTimeFieldAsString(ProgramFieldType type)
getTimeFieldAsString in interface Programtype - The type of the wanted field. Must have a time format.
null, if there is
no value for this field.
protected Object getField(ProgramFieldType type,
int fieldFormat)
public int getFieldCount()
getFieldCount in interface Programpublic Iterator<ProgramFieldType> getFieldIterator()
getFieldIterator in interface ProgramProgramFieldTypes.
public void setBinaryField(ProgramFieldType type,
byte[] value)
type - The type of the field.value - The binary value to set.
public void setTextField(ProgramFieldType type,
String value)
type - The type of the field.value - The text value to set.
public void setIntField(ProgramFieldType type,
int value)
type - The type of the field.value - The int value to set.
public void setTimeField(ProgramFieldType type,
int value)
type - The type of the field.value - The time value to set.
protected void setField(ProgramFieldType type,
int fieldFormat,
Object value)
public static String generateShortInfoFromDescription(String shortInfo)
shortInfo - generate Text from this field
public void setTitle(String title)
title - the new title of this program.public String getTitle()
getTitle in interface Programpublic void setShortInfo(String shortInfo)
If the legth of the short info exceeds 100 characters it will be cut using a smart algorithm.
shortInfo - The new short info.public String getShortInfo()
getShortInfo in interface Programpublic void setDescription(String description)
description - The description.public String getDescription()
getDescription in interface Programpublic int getStartTime()
getStartTime in interface Programpublic int getHours()
getHours in interface Programpublic int getMinutes()
getMinutes in interface Programpublic int getLocalStartTime()
public void setLength(int length)
length - the new length.public int getLength()
getLength in interface Programpublic void setInfo(int info)
info - The new additional information.public int getInfo()
getInfo in interface Programpublic Channel getChannel()
getChannel in interface Programpublic Date getDate()
getDate in interface Programpublic Date getLocalDate()
public String toString()
toString in class Objectpublic boolean equals(Object o)
equals in class Objectpublic boolean equalsAllFields(MutableProgram program)
program -
true, if all fields are equalprotected void setProgramState(int state)
state - The state of this program.public int getProgramState()
getProgramState in interface Programpublic final void validateMarking()
validateMarking in interface ProgramPlugin.getMarkIconsForProgram(Program)protected void setMarkerArr(Marker[] marker)
marker - The marker array.public void setProgramLoadingIsComplete()
public int getMarkPriority()
getMarkPriority in interface Programprotected void setMarkPriority(int markPriority)
|
TV-Browser 2.7.5 API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||