public class TvDataInventory extends Object
This way the TV data directory may be changed by other users, other clients or by hand and events of these changes will be sent anyway. This ensures that all plugins can react on data changed by third parties.
Modifier and Type | Field and Description |
---|---|
static int |
KNOWN |
static int |
OTHER_VERSION |
static int |
UNKNOWN |
Constructor and Description |
---|
TvDataInventory() |
Modifier and Type | Method and Description |
---|---|
String[] |
getKnownDayPrograms()
Gets the keys of all known day programs.
|
int |
getKnownStatus(Date date,
Channel channel,
int version)
Gets whether the given day program is already known to the user.
|
void |
readData(File file)
Loads the inventory list.
|
void |
setKnown(Date date,
Channel channel,
int version)
Sets the day program to "known to the user".
|
void |
setUnknown(Date date,
Channel channel)
Sets the day program to "NOT known to the user".
|
void |
writeData(File file)
Saves the inventory list.
|
public static final int UNKNOWN
public static final int OTHER_VERSION
public static final int KNOWN
public int getKnownStatus(Date date, Channel channel, int version)
Returns
UNKNOWN
if the day program is totally unknown.OTHER_VERSION
if the day program is known but in another
version.KNOWN
if the day program is known in the given version.date
- The day program's datechannel
- The day program's channelversion
- The day program's version (e.g. file size)public void setKnown(Date date, Channel channel, int version)
date
- The day program's datechannel
- The day program's channelversion
- The day program's version (e.g. file size)public void setUnknown(Date date, Channel channel)
date
- The day program's datechannel
- The day program's channelpublic String[] getKnownDayPrograms()
The keys of the day programs are equal to their file name.
TvDataBase.getDayProgramKey(Date, Channel)
public void readData(File file) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
writeData(File)
public void writeData(File file) throws IOException
It is essential that this list is saved at the shut down of TV-Browser! If TV-Browser failes to save the plugin data then the inventory list should NOT be saved too. Doing so the plugins will update themselves automatically on the next startup, because new TV data will be treated as unknown.
IOException
readData(File)
TV-Browser 2.7.6, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)