X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=crawler%2Fkiss%2Fsrc%2Forg%2Fwamblee%2Fcrawler%2Fkiss%2Fguide%2FTime.java;h=de206f557b5739204acceaec86ed26cd61f03eec;hb=07cedd3f0730646ea35a7f668b3e1e872a4605d9;hp=2a15073b7b8ae034b40fff83b9fff31969ea6f9f;hpb=8fab6d870057e8ae4e7358258b8cec4506d2b56d;p=utils diff --git a/crawler/kiss/src/org/wamblee/crawler/kiss/guide/Time.java b/crawler/kiss/src/org/wamblee/crawler/kiss/guide/Time.java index 2a15073b..de206f55 100644 --- a/crawler/kiss/src/org/wamblee/crawler/kiss/guide/Time.java +++ b/crawler/kiss/src/org/wamblee/crawler/kiss/guide/Time.java @@ -98,10 +98,11 @@ public class Time implements Comparable { */ float asFloat() { int hour = _hour; - // Hack to make sure that programs appearing shortly after midnight are sorted - // after those running during the day. - if ( hour <= EARLY_HOUR ) { - hour += HOURS_PER_DAY; + // Hack to make sure that programs appearing shortly after midnight are + // sorted + // after those running during the day. + if (hour <= EARLY_HOUR) { + hour += HOURS_PER_DAY; } return (float) hour + (float) _minute / (float) SECONDS_PER_MINUTE; } @@ -120,13 +121,15 @@ public class Time implements Comparable { } /** - * Compares based on time. - * @param aObject Time object to compare to. + * Compares based on time. + * + * @param aObject + * Time object to compare to. * @return See {@link Comparable#compareTo(T)}. */ public int compareTo(Object aObject) { if (!(aObject instanceof Time)) { - throw new RuntimeException("object not an instance of Time"); + throw new IllegalArgumentException("object not an instance of Time"); } Time time = (Time) aObject; return new Float(asFloat()).compareTo(new Float(time.asFloat()));