TV-Browser 2.7.5 API

devplugin
Class Channel

java.lang.Object
  extended by devplugin.Channel
All Implemented Interfaces:
Comparable<Channel>

public class Channel
extends Object
implements Comparable<Channel>

A class that definies a TV-Browser channel


Field Summary
static int CATEGORY_CINEMA
          The identifier for a channel that is in the category cinema
static int CATEGORY_DIGITAL
          The identifier for a channel that is in the category digital
static int CATEGORY_EVENTS
          The identifier for a channel that is in the category events
static int CATEGORY_NONE
          The identifier for a channel that fits in no other category
static int CATEGORY_PAY_TV
          The identifier for a channel that is in the category pay TV
static int CATEGORY_PAYED_DATA_TV
          The identifier for a channel that is in the category payed data TV
static int CATEGORY_RADIO
          The identifier for a channel that is in the category radio
static int CATEGORY_SPECIAL_MUSIC
          The identifier for a channel that is in the category music
static int CATEGORY_SPECIAL_NEWS
          The identifier for a channel that is in the category news
static int CATEGORY_SPECIAL_OTHER
          The identifier for a channel that is in the category other
static int CATEGORY_SPECIAL_SPORT
          The identifier for a channel that is in the category sport
static int CATEGORY_TV
          The identifier for a channel that is in the category TV
 
Constructor Summary
Channel(String id)
          Creates an instance of this class.
Channel(String id, String country)
          Creates an instance of this class.
Channel(TvDataService dataService, String name)
          Deprecated.  
Channel(TvDataService dataService, String name, String id)
          Deprecated.  
Channel(TvDataService dataService, String name, String id, TimeZone timeZone)
          Deprecated.  
Channel(TvDataService dataService, String name, String id, TimeZone timeZone, String country)
          Deprecated.  
Channel(TvDataService dataService, String name, String id, TimeZone timeZone, String country, String copyrightNotice)
          Creates an instance of this class.
Channel(TvDataService dataService, String name, String id, TimeZone timeZone, String country, String copyrightNotice, String webpage)
          Creates an instance of this class.
Channel(TvDataService dataService, String name, String id, TimeZone timeZone, String country, String copyrightNotice, String webpage, ChannelGroup group)
          Creates an instance of this class.
Channel(TvDataService dataService, String name, String id, TimeZone timeZone, String country, String copyrightNotice, String webpage, ChannelGroup group, Icon icon)
          Creates an instance of this class.
Channel(TvDataService dataService, String name, String id, TimeZone timeZone, String country, String copyrightNotice, String webpage, ChannelGroup group, Icon icon, int categories)
          Creates an instance of this class.
Channel(TvDataService dataService, String name, String id, TimeZone timeZone, String country, String copyrightNotice, String webpage, ChannelGroup group, Icon icon, int categories, String unescapedName)
          Creates an instance of this class.
Channel(TvDataService dataService, String name, TimeZone timeZone)
          Deprecated.  
Channel(TvDataService dataService, String name, TimeZone timeZone, String country)
          Deprecated.  
Channel(TvDataService dataService, String name, TimeZone timeZone, String country, String copyrightNotice)
          Creates an instance of this class.
 
Method Summary
 int compareTo(Channel other)
           
 void copySettingsToChannel(Channel to)
          Deprecated. not needed since we use the ChannelUserSettings class for storing channel user settings
 boolean equals(Object obj)
           
 int getCategories()
          Gets the categories of this channel.
static Channel getChannel(String dataServiceId, String groupId, String country, String channelId)
           
 String getCopyrightNotice()
          Gets the copyright notice for this channel.
 String getCountry()
          Gets the country of this channel.
 TvDataService getDataService()
          Deprecated.  
 TvDataServiceProxy getDataServiceProxy()
          Gets the data service proxy of this channel
 int getDayLightSavingTimeCorrection()
          Gets the day light saving time correction of this channel.
 Icon getDefaultIcon()
          Return the Default-Icon
 String getDefaultName()
          Get the default ChannelName
 String getDefaultWebPage()
          Get the Default WebPage
 int getEndTimeLimit()
          Gets the end time limit in minutes of day.
 ChannelGroup getGroup()
          Gets the channel group of this channel.
 Icon getIcon()
           
 String getIconFileName()
          Deprecated. use getUserIconFileName()
 String getId()
          Gets the id of this channel.
 String getName()
          Gets the name of this channel.
 int getStartTimeLimit()
          Gets the start time limit in minutes of day.
 TimeZone getTimeZone()
          Gets the time zone of this channel.
 String getUnescapedName()
          Gets the unescaped name of this channel.
 String getUniqueId()
          Gets a unique identifier of this channel.
 String getUserChannelName()
          Get the ChannelName used by the User
 String getUserIconFileName()
           
 String getUserWebPage()
          Get the WebPage used by the User
 String getWebpage()
          Gets the webpage for this channel.
 boolean hasIcon()
          Gets if this channel has an icon.
 boolean isTimeLimited()
          Gets if this channel is limited in start and end time.
 boolean isUsingUserIcon()
          Is using the User-Icon if availabe?
static Channel readData(DataInput in, boolean allowNull)
          Method for OnDemandDayProgramFile file format version 2.
static Channel readData(ObjectInputStream in, boolean allowNull)
          Creates an instance of this class from a stream.
 void setChannelCopyrightNotice(String copyrightNotice)
          Sets the copyright notice of this channel.
 void setChannelName(String name)
          Sets the name of this channel.
 void setChannelWebpage(String webpage)
          Sets the webpage of this channel.
 void setDayLightSavingTimeCorrection(int correction)
          Sets the day light saving time correction.
 void setDefaultIcon(Icon icon)
          Sets the Default-Icon.
 void setEndTimeLimit(int endTimeLimit)
          Sets the end time limit to the new value.
 void setIcon(Icon icon)
           
 void setIconFileName(String filename)
          Deprecated. user setUserIconFileName
 void setStartTimeLimit(int startTimeLimit)
          Sets the start time limit to the new value.
 void setUserChannelName(String name)
          Set the ChannelName used by the User
 void setUserIconFileName(String filename)
          Sets the user icon file name.
 void setUserWebPage(String url)
          Seth the WebPage used by the User
 String toString()
           
 void useUserIcon(boolean use)
          Use the User-Icon if available?
 void writeData(ObjectOutputStream out)
          Serialized this object.
 void writeToDataFile(RandomAccessFile out)
          Method for OnDemandDayProgramFile file format version 2.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CATEGORY_NONE

public static final int CATEGORY_NONE
The identifier for a channel that fits in no other category

See Also:
Constant Field Values

CATEGORY_TV

public static final int CATEGORY_TV
The identifier for a channel that is in the category TV

See Also:
Constant Field Values

CATEGORY_RADIO

public static final int CATEGORY_RADIO
The identifier for a channel that is in the category radio

See Also:
Constant Field Values

CATEGORY_CINEMA

public static final int CATEGORY_CINEMA
The identifier for a channel that is in the category cinema

See Also:
Constant Field Values

CATEGORY_EVENTS

public static final int CATEGORY_EVENTS
The identifier for a channel that is in the category events

See Also:
Constant Field Values

CATEGORY_DIGITAL

public static final int CATEGORY_DIGITAL
The identifier for a channel that is in the category digital

See Also:
Constant Field Values

CATEGORY_SPECIAL_MUSIC

public static final int CATEGORY_SPECIAL_MUSIC
The identifier for a channel that is in the category music

See Also:
Constant Field Values

CATEGORY_SPECIAL_SPORT

public static final int CATEGORY_SPECIAL_SPORT
The identifier for a channel that is in the category sport

See Also:
Constant Field Values

CATEGORY_SPECIAL_NEWS

public static final int CATEGORY_SPECIAL_NEWS
The identifier for a channel that is in the category news

See Also:
Constant Field Values

CATEGORY_SPECIAL_OTHER

public static final int CATEGORY_SPECIAL_OTHER
The identifier for a channel that is in the category other

See Also:
Constant Field Values

CATEGORY_PAY_TV

public static final int CATEGORY_PAY_TV
The identifier for a channel that is in the category pay TV

See Also:
Constant Field Values

CATEGORY_PAYED_DATA_TV

public static final int CATEGORY_PAYED_DATA_TV
The identifier for a channel that is in the category payed data TV

See Also:
Constant Field Values
Constructor Detail

Channel

public Channel(TvDataService dataService,
               String name,
               String id,
               TimeZone timeZone,
               String country,
               String copyrightNotice,
               String webpage,
               ChannelGroup group,
               Icon icon,
               int categories,
               String unescapedName)
Creates an instance of this class.

Parameters:
dataService - The data service of this channel.
name - The name of this channel.
id - The id of this channel.
timeZone - The time zone of this channel.
country - The country of this channel.
copyrightNotice - The copyright notice for this channel.
webpage - The webpage of this channel.
group - The group of this channel.
icon - The icon for this channel.
categories - The categories for this channel.
unescapedName - The unescaped name for this channel.

Channel

public Channel(TvDataService dataService,
               String name,
               String id,
               TimeZone timeZone,
               String country,
               String copyrightNotice,
               String webpage,
               ChannelGroup group,
               Icon icon,
               int categories)
Creates an instance of this class.

Parameters:
dataService - The data service of this channel.
name - The name of this channel.
id - The id of this channel.
timeZone - The time zone of this channel.
country - The country of this channel.
copyrightNotice - The copyright notice for this channel.
webpage - The webpage of this channel.
group - The group of this channel.
icon - The icon for this channel.
categories - The categories for this channel.

Channel

public Channel(TvDataService dataService,
               String name,
               String id,
               TimeZone timeZone,
               String country,
               String copyrightNotice,
               String webpage,
               ChannelGroup group,
               Icon icon)
Creates an instance of this class.

Parameters:
dataService - The data service of this channel.
name - The name of this channel.
id - The id of this channel.
timeZone - The time zone of this channel.
country - The country of this channel.
copyrightNotice - The copyright notice for this channel.
webpage - The webpage of this channel.
group - The group of this channel.
icon - The icon for this channel.

Channel

public Channel(TvDataService dataService,
               String name,
               String id,
               TimeZone timeZone,
               String country,
               String copyrightNotice,
               String webpage,
               ChannelGroup group)
Creates an instance of this class.

Parameters:
dataService - The data service of this channel.
name - The name of this channel.
id - The id of this channel.
timeZone - The time zone of this channel.
country - The country of this channel.
copyrightNotice - The copyright notice for this channel.
webpage - The webpage of this channel.
group - The group of this channel.

Channel

public Channel(TvDataService dataService,
               String name,
               String id,
               TimeZone timeZone,
               String country,
               String copyrightNotice,
               String webpage)
Creates an instance of this class.

Parameters:
dataService - The data service of this channel.
name - The name of this channel.
id - The id of this channel.
timeZone - The time zone of this channel.
country - The country of this channel.
copyrightNotice - The copyright notice for this channel.
webpage - The webpage of this channel.

Channel

public Channel(TvDataService dataService,
               String name,
               String id,
               TimeZone timeZone,
               String country,
               String copyrightNotice)
Creates an instance of this class.

Parameters:
dataService - The data service of this channel.
name - The name of this channel.
id - The id of this channel.
timeZone - The time zone of this channel.
country - The country of this channel.
copyrightNotice - The copyright notice for this channel.

Channel

public Channel(TvDataService dataService,
               String name,
               TimeZone timeZone,
               String country,
               String copyrightNotice)
Creates an instance of this class.

Parameters:
dataService - The data service of this channel.
name - The name of this channel.
timeZone - The time zone of this channel.
country - The country of this channel.
copyrightNotice - The copyright notice for this channel.

Channel

public Channel(TvDataService dataService,
               String name,
               String id,
               TimeZone timeZone,
               String country)
Deprecated. 

Creates an instance of this class.

Parameters:
dataService - The data service of this channel.
name - The name of this channel.
id - The id of this channel.
timeZone - The time zone of this channel.
country - The country of this channel.

Channel

public Channel(TvDataService dataService,
               String name,
               TimeZone timeZone,
               String country)
Deprecated. 

Creates an instance of this class.

Parameters:
dataService - The data service of this channel.
name - The name of this channel.
timeZone - The time zone of this channel.
country - The country of this channel.

Channel

public Channel(TvDataService dataService,
               String name,
               String id,
               TimeZone timeZone)
Deprecated. 

Creates an instance of this class.

Parameters:
dataService - The data service of this channel.
name - The name of this channel.
id - The id of this channel.
timeZone - The time zone of this channel.

Channel

public Channel(TvDataService dataService,
               String name,
               TimeZone timeZone)
Deprecated. 

Creates an instance of this class.

Parameters:
dataService - The data service of this channel.
name - The name of this channel.
timeZone - The time zone of this channel.

Channel

public Channel(TvDataService dataService,
               String name,
               String id)
Deprecated. 

Creates an instance of this class.

Parameters:
dataService - The data service of this channel.
name - The name of this channel.
id - The id of this channel.

Channel

public Channel(TvDataService dataService,
               String name)
Deprecated. 

Creates an instance of this class.

Parameters:
dataService - The data service of this channel.
name - The name of this channel.

Channel

public Channel(String id,
               String country)
Creates an instance of this class.

Parameters:
id - The id of this channel.
country - The country of this channel.

Channel

public Channel(String id)
Creates an instance of this class.

Parameters:
id - The id of this channel.
Method Detail

readData

public static Channel readData(ObjectInputStream in,
                               boolean allowNull)
                        throws IOException,
                               ClassNotFoundException
Creates an instance of this class from a stream.

Parameters:
in - The stream to load the data from.
allowNull - True if the method is allowed to return null.
Returns:
The load channel or null if allowNull is true and the channel could not be load.
Throws:
IOException
ClassNotFoundException

readData

public static Channel readData(DataInput in,
                               boolean allowNull)
                        throws IOException,
                               ClassNotFoundException
Method for OnDemandDayProgramFile file format version 2.

Parameters:
in - The file too read the Data from.
allowNull -
Returns:
channel
Throws:
IOException
ClassNotFoundException
Since:
2.2

writeToDataFile

public void writeToDataFile(RandomAccessFile out)
                     throws IOException
Method for OnDemandDayProgramFile file format version 2.

Parameters:
out - The file to write the Data in.
Throws:
IOException
Since:
2.2

writeData

public void writeData(ObjectOutputStream out)
               throws IOException
Serialized this object.

Parameters:
out - The stream to write the values of this channel to.
Throws:
IOException

getCopyrightNotice

public String getCopyrightNotice()
Gets the copyright notice for this channel.

Returns:
The copyright notice for this channel.

getWebpage

public String getWebpage()
Gets the webpage for this channel.

Returns:
The webpage for this channel.

getGroup

public ChannelGroup getGroup()
Gets the channel group of this channel.

Returns:
The channel group of this channel.

getCategories

public int getCategories()
Gets the categories of this channel.

Returns:
The categories of this channel.

getChannel

public static Channel getChannel(String dataServiceId,
                                 String groupId,
                                 String country,
                                 String channelId)
Parameters:
dataServiceId - The id of the data service of the channel to get.
groupId - The group id of the channel to get.
country - The country of the channel to get.
channelId - The id of the channel to get.
Returns:
The channel with the given ids or null if no channel with the ids was found.

getTimeZone

public TimeZone getTimeZone()
Gets the time zone of this channel.

Returns:
The time zone of this channel.

getCountry

public String getCountry()
Gets the country of this channel.

Returns:
The country of this channel.

setDayLightSavingTimeCorrection

public void setDayLightSavingTimeCorrection(int correction)
Sets the day light saving time correction.

Parameters:
correction - The new day light saving time correction.

getDayLightSavingTimeCorrection

public int getDayLightSavingTimeCorrection()
Gets the day light saving time correction of this channel.

Returns:
The day light saving time correction of this channel.

getDataService

public TvDataService getDataService()
Deprecated. 

Gets the data service of this channel

Returns:
The deprecated data service of this channel

getDataServiceProxy

public TvDataServiceProxy getDataServiceProxy()
Gets the data service proxy of this channel

Returns:
The data service proxy of this channel

setDefaultIcon

public void setDefaultIcon(Icon icon)
Sets the Default-Icon. This Icon is shown if no Icon is set by the User

Parameters:
icon - Default-Icon

setIcon

public void setIcon(Icon icon)
Parameters:
icon - The new icon or null to remove the current icon

toString

public String toString()
Overrides:
toString in class Object

getName

public String getName()
Gets the name of this channel.

Returns:
The name of this channel.

getId

public String getId()
Gets the id of this channel.

Returns:
The id of this channel.

copySettingsToChannel

public void copySettingsToChannel(Channel to)
Deprecated. not needed since we use the ChannelUserSettings class for storing channel user settings

Copies the Settins in this Channel (DaylightSaving etc..) into another Channel

Parameters:
to - to this Channel

getIcon

public Icon getIcon()
Returns:
the Icon for this Channel

hasIcon

public boolean hasIcon()
Gets if this channel has an icon.

Returns:
True if this channel has an icon, false otherwise.

getIconFileName

public String getIconFileName()
Deprecated. use getUserIconFileName()

Gets the Filename for an Icon

Returns:
Filename of the Icon

setIconFileName

public void setIconFileName(String filename)
Deprecated. user setUserIconFileName

Sets the Filename for an Icon

Parameters:
filename - Filename for Icon

setUserIconFileName

public void setUserIconFileName(String filename)
Sets the user icon file name.

Parameters:
filename - The file name of ths user icon file.

getUserIconFileName

public String getUserIconFileName()
Returns:
null, if no user icon filename is specified

useUserIcon

public void useUserIcon(boolean use)
Use the User-Icon if available?

Parameters:
use - true for using User-Icon

isUsingUserIcon

public boolean isUsingUserIcon()
Is using the User-Icon if availabe?

Returns:
Using User-Icon if available?

getDefaultIcon

public Icon getDefaultIcon()
Return the Default-Icon

Returns:
Default-Icon

setUserChannelName

public void setUserChannelName(String name)
Set the ChannelName used by the User

Parameters:
name - new ChannelName
Since:
2.1

getUserChannelName

public String getUserChannelName()
Get the ChannelName used by the User

Returns:
ChannelName
Since:
2.1

getDefaultName

public String getDefaultName()
Get the default ChannelName

Returns:
default ChannelName
Since:
2.1

setUserWebPage

public void setUserWebPage(String url)
Seth the WebPage used by the User

Parameters:
url - WebPage
Since:
2.1

getUserWebPage

public String getUserWebPage()
Get the WebPage used by the User

Returns:
WebPage
Since:
2.1

getDefaultWebPage

public String getDefaultWebPage()
Get the Default WebPage

Returns:
WebPage
Since:
2.1

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

isTimeLimited

public boolean isTimeLimited()
Gets if this channel is limited in start and end time.

Returns:
True if this channel is time limited.
Since:
2.2.4/2.6

getStartTimeLimit

public int getStartTimeLimit()
Gets the start time limit in minutes of day. This is used to exclude programs from the day program that starts before the start time limit.

Returns:
The start time limit in minutes of day.
Since:
2.2.4/2.6

setStartTimeLimit

public void setStartTimeLimit(int startTimeLimit)
Sets the start time limit to the new value.

Parameters:
startTimeLimit - The new value for start time limit in minutes of day.
Since:
2.2.4/2.6

getEndTimeLimit

public int getEndTimeLimit()
Gets the end time limit in minutes of day. This is used to exclude programs from the day program that starts after the end time limit.

Returns:
The start time limit in minutes of day.
Since:
2.2.4/2.6

setEndTimeLimit

public void setEndTimeLimit(int endTimeLimit)
Sets the end time limit to the new value.

Parameters:
endTimeLimit - The new value for end time limit in minutes of day.
Since:
2.2.4/2.6

compareTo

public int compareTo(Channel other)
Specified by:
compareTo in interface Comparable<Channel>

setChannelName

public void setChannelName(String name)
Sets the name of this channel. If this is used by a Plugin nothing will happen.

Parameters:
name - The new name for the channel.
Since:
2.2.5/2.6.3

setChannelCopyrightNotice

public void setChannelCopyrightNotice(String copyrightNotice)
Sets the copyright notice of this channel. If this is used by a Plugin nothing will happen.

Parameters:
copyrightNotice - The new copyright notice for the channel.
Since:
2.2.5/2.6.3

setChannelWebpage

public void setChannelWebpage(String webpage)
Sets the webpage of this channel. If this is used by a Plugin nothing will happen.

Parameters:
webpage - The new webpage for the channel.
Since:
2.2.5/2.6.3

getUnescapedName

public String getUnescapedName()
Gets the unescaped name of this channel.

Returns:
The unescaped name of this channel.

getUniqueId

public String getUniqueId()
Gets a unique identifier of this channel.

Returns:
The unique identifier of this channel.
Since:
2.7

TV-Browser 2.7.5 API

TV-Browser 2.7.5, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)