@Test public void testParseHour() { Hour h = Hour.parseHour("2002-01-29 13"); assertEquals(13, h.getHour()); }
public static Hour parseHour(String s) { Hour result = null; s = s.trim(); String daystr = s.substring(0, Math.min(10, s.length())); Day day = Day.parseDay(daystr); if (day != null) { String hourstr = s.substring( Math.min(daystr.length() + 1, s.length()), s.length() ); hourstr = hourstr.trim(); int hour = Integer.parseInt(hourstr); if ((hour >= FIRST_HOUR_IN_DAY) && (hour <= LAST_HOUR_IN_DAY)) { result = new Hour(hour, day); } } return result; }
Hour extends RegularTimePeriod implements Serializable { public static Hour parseHour(String s) { Hour result = null; s = s.trim(); String daystr = s.substring(0, Math.min(10, s.length())); Day day = Day.parseDay(daystr); if (day != null) { String hourstr = s.substring( Math.min(daystr.length() + 1, s.length()), s.length() ); hourstr = hourstr.trim(); int hour = Integer.parseInt(hourstr); if ((hour >= FIRST_HOUR_IN_DAY) && (hour <= LAST_HOUR_IN_DAY)) { result = new Hour(hour, day); } } return result; } }
Hour extends RegularTimePeriod implements Serializable { public static Hour parseHour(String s) { Hour result = null; s = s.trim(); String daystr = s.substring(0, Math.min(10, s.length())); Day day = Day.parseDay(daystr); if (day != null) { String hourstr = s.substring( Math.min(daystr.length() + 1, s.length()), s.length() ); hourstr = hourstr.trim(); int hour = Integer.parseInt(hourstr); if ((hour >= FIRST_HOUR_IN_DAY) && (hour <= LAST_HOUR_IN_DAY)) { result = new Hour(hour, day); } } return result; } Hour();  Hour(int hour, Day day);  Hour(int hour, int day, int month, int year);  Hour(Date time);  Hour(Date time, TimeZone zone, Locale locale); }
Hour extends RegularTimePeriod implements Serializable { public static Hour parseHour(String s) { Hour result = null; s = s.trim(); String daystr = s.substring(0, Math.min(10, s.length())); Day day = Day.parseDay(daystr); if (day != null) { String hourstr = s.substring( Math.min(daystr.length() + 1, s.length()), s.length() ); hourstr = hourstr.trim(); int hour = Integer.parseInt(hourstr); if ((hour >= FIRST_HOUR_IN_DAY) && (hour <= LAST_HOUR_IN_DAY)) { result = new Hour(hour, day); } } return result; } Hour();  Hour(int hour, Day day);  Hour(int hour, int day, int month, int year);  Hour(Date time);  Hour(Date time, TimeZone zone, Locale locale); int getHour(); Day getDay(); int getYear(); int getMonth(); int getDayOfMonth(); @Override long getFirstMillisecond(); @Override long getLastMillisecond(); @Override void peg(Calendar calendar); @Override RegularTimePeriod previous(); @Override RegularTimePeriod next(); @Override long getSerialIndex(); @Override long getFirstMillisecond(Calendar calendar); @Override long getLastMillisecond(Calendar calendar); @Override boolean equals(Object obj); @Override String toString(); @Override int hashCode(); @Override int compareTo(TimePeriod o1); static Hour parseHour(String s); }
Hour extends RegularTimePeriod implements Serializable { public static Hour parseHour(String s) { Hour result = null; s = s.trim(); String daystr = s.substring(0, Math.min(10, s.length())); Day day = Day.parseDay(daystr); if (day != null) { String hourstr = s.substring( Math.min(daystr.length() + 1, s.length()), s.length() ); hourstr = hourstr.trim(); int hour = Integer.parseInt(hourstr); if ((hour >= FIRST_HOUR_IN_DAY) && (hour <= LAST_HOUR_IN_DAY)) { result = new Hour(hour, day); } } return result; } Hour();  Hour(int hour, Day day);  Hour(int hour, int day, int month, int year);  Hour(Date time);  Hour(Date time, TimeZone zone, Locale locale); int getHour(); Day getDay(); int getYear(); int getMonth(); int getDayOfMonth(); @Override long getFirstMillisecond(); @Override long getLastMillisecond(); @Override void peg(Calendar calendar); @Override RegularTimePeriod previous(); @Override RegularTimePeriod next(); @Override long getSerialIndex(); @Override long getFirstMillisecond(Calendar calendar); @Override long getLastMillisecond(Calendar calendar); @Override boolean equals(Object obj); @Override String toString(); @Override int hashCode(); @Override int compareTo(TimePeriod o1); static Hour parseHour(String s); static final int FIRST_HOUR_IN_DAY; static final int LAST_HOUR_IN_DAY; }