diff options
Diffstat (limited to 'vdrmanager/src/de/bjusystems/vdrmanager/data/Epg.java')
-rw-r--r-- | vdrmanager/src/de/bjusystems/vdrmanager/data/Epg.java | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/Epg.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/Epg.java new file mode 100644 index 0000000..e228565 --- /dev/null +++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/Epg.java @@ -0,0 +1,65 @@ +package de.bjusystems.vdrmanager.data; + +import java.util.Date; + +/** + * Class for EPG events + * @author bju + */ +public class Epg implements Event { + + private final String channelNumber; + private final String channelName; + private final String title; + private final String description; + private final Date start; + private final Date stop; + private Timer timer; + + public Epg(final String line) { + + final String[] words = line.split(":"); + + channelNumber = words[0].substring(1); + channelName = words[1]; + start = new Date(Long.parseLong(words[2])*1000); + stop = new Date(Long.parseLong(words[3])*1000); + title = words[4]; + description = words.length > 5 ? words[5] : ""; + } + + public String getChannelNumber() { + return channelNumber; + } + public String getChannelName() { + return channelName; + } + public String getTitle() { + return title; + } + public String getDescription() { + return description; + } + public Date getStart() { + return start; + } + public Date getStop() { + return stop; + } + + public Timer getTimer() { + return timer; + } + + public void setTimer(final Timer timer) { + this.timer = timer; + } + + public TimerState getTimerState() { + if (timer == null) { + return TimerState.None; + } else { + return timer.getTimerState(); + } + } +} |