public class ProgramUtilities
extends java.lang.Object
Constructor and Description |
---|
ProgramUtilities() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String[] |
getActorNames(Program program)
extract the actor names from the actor field
|
static int |
getAgeLimit(java.lang.String rating)
get the age limit for a given textual rating
|
static java.awt.Color |
getColorForProgramImportance(java.awt.Color color,
byte importance)
Creates a color that uses the program importance for alpha value.
|
static java.awt.Color |
getColorForProgramImportance(java.awt.Color color,
Program program)
Creates a color that uses the program importance for alpha value.
|
static java.util.Iterator<Program> |
getJointProgramIteratorFor(Date date,
Channel channel)
Gets an iterator that contains all programs for the given date of the given
channel and it's joint channel if there one or it's base channel if there one.
|
static java.util.ArrayList<Program> |
getJointProgramListForYesterdayTodayTomorrow(Date today,
Channel channel,
boolean excludeExpired)
Gets combined day program for yesterday, today and tomorrow.
|
static java.util.Comparator<Program> |
getProgramComparator()
comparator to sort programs by date, time and position in channel list
|
static byte |
getProgramImportance(Program program)
Gets the program importance of the given program.
|
static java.lang.String |
getTimeZoneCorrectedProgramId(java.lang.String progID)
Gets the time zone corrected program id of the given program id.
|
static boolean |
isNotInTimeRange(int timeFrom,
int timeTo,
Program p)
A helper method to get if a program is not in a time range.
|
static boolean |
isOnAir(Program p)
Helper method to check if a program runs.
|
static java.util.ArrayList<java.lang.String>[] |
splitActors(Program program)
get the actors and roles of a program
|
static java.lang.String[] |
splitPersons(java.lang.String field)
extract a list of person names out of the given string
|
public static boolean isOnAir(Program p)
p
- The program to check.public static java.util.Comparator<Program> getProgramComparator()
public static boolean isNotInTimeRange(int timeFrom, int timeTo, Program p)
timeFrom
- The beginning of the time range to checktimeTo
- The ending of the time rangep
- The program to checkpublic static java.util.ArrayList<java.lang.String>[] splitActors(Program program)
program
- the program containing the actorspublic static java.lang.String[] getActorNames(Program program)
program
- the program to work onpublic static java.lang.String getTimeZoneCorrectedProgramId(java.lang.String progID)
progID
- The id to get the time zone corrected for.public static java.lang.String[] splitPersons(java.lang.String field)
field
- public static int getAgeLimit(java.lang.String rating)
rating
- public static java.awt.Color getColorForProgramImportance(java.awt.Color color, Program program)
color
- The color to use for alpha value change.program
- The program to get the changed color for.public static java.awt.Color getColorForProgramImportance(java.awt.Color color, byte importance)
color
- The color to use for alpha value change.importance
- The importance to get the changed color for.public static byte getProgramImportance(Program program)
program
- The program to get the program importance forpublic static java.util.Iterator<Program> getJointProgramIteratorFor(Date date, Channel channel)
date
- The date to get the iterator for.channel
- The channel to get the iterator for.public static java.util.ArrayList<Program> getJointProgramListForYesterdayTodayTomorrow(Date today, Channel channel, boolean excludeExpired)
today
- The date of today.channel
- The channel to get the programs forexcludeExpired
- If expired programs should be excludedTV-Browser 3.4.4, Copyright (C) 2004-2008 TV-Browser Team (dev@tvbrowser.org)