public class DayProgramFile extends AbstractFile
Modifier and Type | Field and Description |
---|---|
static TvDataLevel[] |
LEVEL_ARR |
static Localizer |
mLocalizer
The localizer for this class.
|
Constructor and Description |
---|
DayProgramFile() |
DayProgramFile(Date date,
Channel channel) |
Modifier and Type | Method and Description |
---|---|
void |
addProgramFrame(ProgramFrame frame) |
void |
checkFormat() |
boolean |
equals(Object obj) |
Channel |
getChannel() |
static String |
getChannelNameFromFileName(String fileName) |
static String |
getCountryFromFileName(String fileName) |
Date |
getDate() |
static Date |
getDateFromFileName(String fileName) |
static String |
getLevelFromFileName(String fileName) |
static int |
getLevelIndexForId(String levelId) |
String |
getProgramFileName() |
static String |
getProgramFileName(Date date,
Channel channel) |
static String |
getProgramFileName(Date date,
String country,
String channel) |
static String |
getProgramFileName(Date date,
String country,
String channel,
String level) |
static String |
getProgramFileName(Date date,
String country,
String channel,
String level,
int updateVersion) |
ProgramFrame |
getProgramFrameAt(int index) |
int |
getProgramFrameCount() |
int |
getProgramFrameIndexForId(int id) |
int |
getVersion() |
void |
merge(DayProgramFile otherProg)
Merges the day program file with a day program file of another level.
|
void |
readFromStream(InputStream stream,
DownloadJob job) |
static int |
readVersionFromFile(File file) |
static int |
readVersionFromStream(InputStream stream)
Reads only the version from a stream.
|
void |
removeAllProgramFrames() |
void |
removeProgramFrameAt(int index) |
void |
setVersion(int version) |
void |
updateCompleteFile(DayProgramFile updateFile)
Updates this complete file with an update file.
|
void |
updateUpdateFile(DayProgramFile updateFile)
Updates this update file with an update file.
|
void |
writeToStream(OutputStream stream,
File file) |
readFromFile, writeToFile
public static final Localizer mLocalizer
public static final TvDataLevel[] LEVEL_ARR
public Date getDate()
public Channel getChannel()
public int getVersion()
public void setVersion(int version)
version
- public int getProgramFrameCount()
public ProgramFrame getProgramFrameAt(int index)
public void removeProgramFrameAt(int index)
public void removeAllProgramFrames()
public void addProgramFrame(ProgramFrame frame)
public int getProgramFrameIndexForId(int id)
public void updateCompleteFile(DayProgramFile updateFile) throws FileFormatException
updateFile
- The update to use to patch this day program file.FileFormatException
- If the update file does not have a higher
version as this file.updateUpdateFile(DayProgramFile)
,
merge(DayProgramFile)
public void updateUpdateFile(DayProgramFile updateFile) throws FileFormatException
updateFile
- The update to use to patch this day program file.FileFormatException
- If the update file does not have a higher
version as this file.updateCompleteFile(DayProgramFile)
,
merge(DayProgramFile)
public void merge(DayProgramFile otherProg) throws FileFormatException
otherProg
- The day program file to merge with this file.FileFormatException
- If merging failed.updateCompleteFile(DayProgramFile)
,
updateUpdateFile(DayProgramFile)
public void checkFormat() throws FileFormatException
FileFormatException
public static int readVersionFromStream(InputStream stream) throws IOException, FileFormatException
stream
- The stream to read fromIOException
- If reading failedFileFormatException
- If the file has a unknown file versionpublic static int readVersionFromFile(File file) throws IOException, FileFormatException
IOException
FileFormatException
public void readFromStream(InputStream stream, DownloadJob job) throws IOException, FileFormatException
readFromStream
in class AbstractFile
IOException
FileFormatException
public void writeToStream(OutputStream stream, File file) throws IOException, FileFormatException
writeToStream
in class AbstractFile
IOException
FileFormatException
public String getProgramFileName()
public static String getProgramFileName(Date date, String country, String channel)
public static String getProgramFileName(Date date, String country, String channel, String level)
public static String getProgramFileName(Date date, String country, String channel, String level, int updateVersion)
public static Date getDateFromFileName(String fileName) throws TvBrowserException
TvBrowserException
public static String getCountryFromFileName(String fileName) throws TvBrowserException
TvBrowserException
public static String getChannelNameFromFileName(String fileName) throws TvBrowserException
TvBrowserException
public static String getLevelFromFileName(String fileName) throws TvBrowserException
TvBrowserException
public static int getLevelIndexForId(String levelId)
TV-Browser 2.7.6, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)