|
TV-Browser 3.3.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tvdataservice.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 java.lang.String |
ID_DATE_FORMAT
The date format, which is used in the unique ID |
static int |
MAX_SHORT_INFO_LENGTH
The maximum length of a short info. |
protected java.lang.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,
boolean isLoading)
Creates a new instance of MutableProgram. |
Method Summary | |
---|---|
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 contents |
protected 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-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. |
java.lang.String |
getDateString()
get the date of this program as nicely formatted string |
java.lang.String |
getDescription()
Returns a description about the program. |
java.lang.String |
getEndTimeString()
get the end time of this program as nicely formatted string |
int |
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 all Marker s 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. |
protected java.lang.Object |
getObjectValueField(ProgramFieldType type)
access method to object field values. this allows ondemand programs to reimplement the access |
int |
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 string |
java.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 existence |
int |
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 |
setMarkerArr(Marker[] marker)
Sets the marker array of this program. |
protected void |
setMarkPriority(int markPriority)
Sets the mark priority for this program |
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. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MAX_SHORT_INFO_LENGTH
protected static final Marker[] EMPTY_MARKER_ARR
public static final java.lang.String ID_DATE_FORMAT
protected java.lang.String mTitle
Constructor Detail |
---|
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 currently 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 currently loading.setProgramLoadingIsComplete()
Method Detail |
---|
public void addChangeListener(javax.swing.event.ChangeListener listener)
addChangeListener
in interface Program
listener
- the ChangeListener to addfireStateChanged()
,
removeChangeListener(javax.swing.event.ChangeListener)
public void removeChangeListener(javax.swing.event.ChangeListener listener)
removeChangeListener
in interface Program
listener
- the ChangeListener to removefireStateChanged()
,
addChangeListener(javax.swing.event.ChangeListener)
protected void fireStateChanged()
addChangeListener(javax.swing.event.ChangeListener)
,
EventListenerList
public final java.lang.String getTimeString()
Program
getTimeString
in interface Program
public final java.lang.String getEndTimeString()
Program
getEndTimeString
in interface Program
public final java.lang.String getDateString()
Program
getDateString
in interface Program
public boolean isOnAir()
isOnAir
in interface Program
public final void mark(Plugin javaPlugin)
mark
in interface Program
javaPlugin
- 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 Program
javaPlugin
- The plugin to remove the mark for.public final void mark(Marker marker)
mark
in interface Program
marker
- 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 Program
marker
- The plugin to remove the mark for.public Marker[] getMarkerArr()
Program
Marker
s that have marked this program.
getMarkerArr
in interface Program
public boolean isExpired()
isExpired
in interface Program
public java.lang.String getID()
getID
in interface Program
public java.lang.String getUniqueID()
getUniqueID
in interface Program
public byte[] getBinaryField(ProgramFieldType type)
Program
getBinaryField
in interface Program
type
- The type of the wanted field. Must have a binary format.
null
, if there is no
value for this field.public java.lang.String getTextField(ProgramFieldType type)
Program
getTextField
in interface Program
type
- The type of the wanted field. Must have a text format.
null
, if there is no
value for this field.protected java.lang.Object getObjectValueField(ProgramFieldType type)
type
-
public int getIntField(ProgramFieldType type)
Program
getIntField
in interface Program
type
- The type of the wanted field. Must have a int format.
-1
, if there is no
value for this field.public java.lang.String getIntFieldAsString(ProgramFieldType type)
getIntFieldAsString
in interface Program
type
- 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 Program
type
- The type of the wanted field. Must have a time format.
-1
, if there is no
value for this field.public java.lang.String getTimeFieldAsString(ProgramFieldType type)
getTimeFieldAsString
in interface Program
type
- The type of the wanted field. Must have a time format.
null
, if there is
no value for this field.public int getFieldCount()
getFieldCount
in interface Program
public java.util.Iterator<ProgramFieldType> getFieldIterator()
getFieldIterator
in interface Program
ProgramFieldType
s.public void setBinaryField(ProgramFieldType type, byte[] value)
type
- The type of the field.value
- The binary value to set.protected void setObjectValueField(ProgramFieldType type, java.lang.Object value)
public void setTextField(ProgramFieldType type, java.lang.String inValue)
type
- The type of the field.inValue
- 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.public static java.lang.String generateShortInfoFromDescription(java.lang.String shortInfo)
shortInfo
- generate Text from this field
public void setTitle(java.lang.String title)
title
- the new title of this program.public java.lang.String getTitle()
getTitle
in interface Program
public void setShortInfo(java.lang.String shortInfo)
If the length of the short info exceeds 100 characters it will be cut using a smart algorithm.
shortInfo
- The new short info.public java.lang.String getShortInfo()
getShortInfo
in interface Program
public void setDescription(java.lang.String description)
description
- The description.public java.lang.String getDescription()
getDescription
in interface Program
public int getStartTime()
getStartTime
in interface Program
public int getHours()
getHours
in interface Program
public int getMinutes()
getMinutes
in interface Program
public int getLocalStartTime()
public void setLength(int length)
length
- the new length.public int getLength()
Program
getLength
in interface Program
public void setInfo(int info)
info
- The new additional information.public int getInfo()
getInfo
in interface Program
public Channel getChannel()
getChannel
in interface Program
public Date getDate()
getDate
in interface Program
public Date getLocalDate()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public 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 Program
public final void validateMarking()
validateMarking
in interface Program
Plugin.getMarkIconsForProgram(Program)
protected void setMarkerArr(Marker[] marker)
marker
- The marker array.public void setProgramLoadingIsComplete()
public int getMarkPriority()
getMarkPriority
in interface Program
protected void setMarkPriority(int markPriority)
public boolean hasFieldValue(ProgramFieldType type)
Program
null
value. use this
method if you don't need the value of the field, but only the knowledge
about existence
hasFieldValue
in interface Program
type
- field type
|
TV-Browser 3.3.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |