191 |
|
return layout; |
192 |
|
} |
193 |
|
|
194 |
+ |
/** |
195 |
+ |
* Takes a time period in seconds and converts it to a |
196 |
+ |
* reasonable message. |
197 |
+ |
* |
198 |
+ |
* @param time the time period in seconds |
199 |
+ |
* @return a String respresentation of the given time period |
200 |
+ |
*/ |
201 |
+ |
public static String getTimeString(long time) { |
202 |
+ |
String timeString = null; |
203 |
+ |
if (time >= 3600) { |
204 |
+ |
timeString = ((time/60) / 60) + " hour(s)"; |
205 |
+ |
} else if (time >= 60) { |
206 |
+ |
timeString = (time / 60) + " minute(s)"; |
207 |
+ |
} else { |
208 |
+ |
timeString = time + " second(s)"; |
209 |
+ |
} |
210 |
+ |
return timeString; |
211 |
+ |
} |
212 |
|
|
213 |
|
//---CONSTRUCTORS--- |
214 |
|
|