cab43a6b76affb79b3c5b9fe1a5a3bd854154672
[utils] / mythtv / monitor / src / main / java / org / wamblee / mythtv / Recording.java
1 /*
2  * Copyright 2006 the original author or authors.
3  * 
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  * 
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  * 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.wamblee.mythtv;
18
19 import java.io.Serializable;
20 import java.util.Date;
21
22 /**
23  * 
24  */
25 public class Recording implements Serializable {
26
27     private Channel _channel;
28     private Date _starttime;
29
30   
31     private String _basename;
32
33     private Date _progstart;
34  
35     private String _title;
36
37     private String _subtitle;
38     
39     private long _filesize;
40
41     protected Recording() {
42         // Empty
43     }
44
45     /**
46      * @return the channel
47      */
48     public Channel getChannel() {
49         return _channel;
50     }
51
52     /**
53      * @return the basename
54      */
55     public String getBasename() {
56         return _basename;
57     }
58
59     /**
60      * @return the progstart
61      */
62     public Date getStartTime() {
63         return _starttime;
64     }
65
66     /**
67      * @return the progstart
68      */
69     public Date getProgstart() {
70         return _progstart;
71     }
72     
73     /**
74      * @return the title
75      */
76     public String getTitle() {
77         return _title;
78     }
79
80     /**
81      * @return the subtitle
82      */
83     public String getSubtitle() {
84         return _subtitle;
85     }
86     
87     /**
88      * @return the filesize
89      */
90     public long getFilesize() {
91         return _filesize;
92     }
93     
94     public void setFilesize(long aFilesize) { 
95         _filesize = aFilesize; 
96     }
97     
98     /* (non-Javadoc)
99      * @see java.lang.Object#toString()
100      */
101     @Override
102     public String toString() {
103         return "Recording(" + _channel + "," + _basename + "," + _progstart + "," + _title + "," + _subtitle + ")";
104     }
105     
106     /* (non-Javadoc)
107      * @see java.lang.Object#equals(java.lang.Object)
108      */
109     @Override
110     public boolean equals(Object aObj) {
111         if ( !(aObj instanceof Recording)) { 
112             return false;
113         }
114         Recording recording = (Recording)aObj; 
115         return _channel.equals(recording._channel) && _starttime.equals(recording._starttime); 
116     }
117     
118     /* (non-Javadoc)
119      * @see java.lang.Object#hashCode()
120      */
121     @Override
122     public int hashCode() {
123         return _channel.hashCode()*10 + ((int)_starttime.getTime() %10); 
124     }
125
126 }