1 /*
2  * This file is part of libbluray
3  * Copyright (C) 2016  VideoLAN
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library. If not, see
17  * <http://www.gnu.org/licenses/>.
18  */
19 
20 package javax.tv.util;
21 
22 import java.util.Enumeration;
23 import java.io.Serializable;
24 import java.util.Vector;
25 
26 import org.videolan.Logger;
27 
28 public class TVTimerSpec implements Serializable
29 {
30     private boolean absolute;
31     private boolean regular;
32     private boolean repeat;
33     private long    time;
34 
TVTimerSpec()35     public TVTimerSpec() {
36         absolute = true;
37         repeat = false;
38         regular = true;
39         time = 0L;
40     }
41 
getTime()42     public long getTime() {
43         return time;
44     }
45 
isAbsolute()46     public boolean isAbsolute() {
47         return absolute;
48     }
49 
isRegular()50     public boolean isRegular() {
51         return regular;
52     }
53 
isRepeat()54     public boolean isRepeat() {
55         return repeat;
56     }
57 
addTVTimerWentOffListener(TVTimerWentOffListener l)58     public void addTVTimerWentOffListener(TVTimerWentOffListener l) {
59         Logger.unimplemented(TVTimer.class.getName(), "addTVTimerWentOffListener");
60     }
61 
removeTVTimerWentOffListener(TVTimerWentOffListener l)62     public void removeTVTimerWentOffListener(TVTimerWentOffListener l) {
63         Logger.unimplemented(TVTimer.class.getName(), "removeTVTimerWentOffListener");
64     }
65 
notifyListeners(TVTimer source)66     public void notifyListeners(TVTimer source) {
67         Logger.unimplemented(TVTimer.class.getName(), "notifyListeners");
68     }
69 
setAbsolute(boolean absolute)70     public void setAbsolute(boolean absolute) {
71         this.absolute = absolute;
72     }
73 
setAbsoluteTime(long when)74     public void setAbsoluteTime(long when) {
75         if (when < 0L) {
76             throw new IllegalArgumentException();
77         }
78         setAbsolute(true);
79         setTime(when);
80         setRepeat(false);
81     }
82 
setDelayTime(long delay)83     public void setDelayTime(long delay) {
84         if (delay < 0L) {
85             throw new IllegalArgumentException();
86         }
87         setAbsolute(false);
88         setTime(delay);
89         setRepeat(false);
90     }
91 
setRegular(boolean regular)92     public void setRegular(boolean regular) {
93         this.regular = regular;
94     }
95 
setRepeat(boolean repeat)96     public void setRepeat(boolean repeat) {
97         this.repeat = repeat;
98     }
99 
setTime(long time)100     public void setTime(long time) {
101         if (time < 0L)
102             throw new IllegalArgumentException();
103         this.time = time;
104     }
105 
106     private static final long serialVersionUID = -4714470266350436478L;
107 }
108