diff options
author | herrlado <herrlado@gmail.com> | 2011-09-23 11:57:10 +0200 |
---|---|---|
committer | herrlado <herrlado@gmail.com> | 2011-09-23 11:57:10 +0200 |
commit | 1389165252db7bb0915b25ad7eedbdfae05597ee (patch) | |
tree | 9bef7d5b78906593a55504e920e80c5cb1d1d13b /vdrmanager | |
parent | 1bbe62e96bbc7564202790d4e6bec1af135dfb14 (diff) | |
download | vdr-manager-1389165252db7bb0915b25ad7eedbdfae05597ee.tar.gz vdr-manager-1389165252db7bb0915b25ad7eedbdfae05597ee.tar.bz2 |
Provider added
Diffstat (limited to 'vdrmanager')
-rw-r--r-- | vdrmanager/src/de/bjusystems/vdrmanager/data/Channel.java | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/Channel.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/Channel.java index bb9e0a7..29215e4 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/data/Channel.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/Channel.java @@ -1,21 +1,27 @@ package de.bjusystems.vdrmanager.data; - public class Channel { private final int number; private final String name; + private final String provider; public Channel(final String channelData) { - - final String[] words = channelData.split(":"); + String[] words = channelData.split(":"); this.number = Integer.valueOf(words[0].substring(1)); - this.name = words[1]; + if (words.length > 2) { + this.name = words[1]; + this.provider = words[2]; + } else { + this.name = words[1]; + this.provider = "Unknown"; + } } public Channel() { this.number = 0; this.name = "Unknown"; + this.provider = "Unknown"; } public boolean isGroupSeparator() { @@ -30,12 +36,18 @@ public class Channel { return name; } + public String getProvider() { + return provider; + } + @Override public String toString() { final StringBuilder text = new StringBuilder(); text.append(number); text.append(" - "); text.append(name); + text.append(" : "); + text.append(provider); return text.toString(); } } |