Time¶
-
public class
Time
implements Comparable<Time>, Serializable¶ Represents time as number of hours and minutes.
Constructors¶
Time¶
-
public
Time
(int hour, int minute)¶ Constructor.
Parameters: - hour – the hour to be stored, not null
- minute – the minute to be stored, not null
Time¶
Methods¶
getHour¶
getMinute¶
isAfter¶
isAfterOrEqual¶
isBefore¶
isBeforeOrEqual¶
isBetween¶
parseTime¶
-
public static Time
parseTime
(String time, String separator)¶ Parses given
String
using the separator.Parameters: - time – the
String
to be parsed, null returns null - separator – the separator used to distinguish minute from hour, not null
Throws: - IllegalArgumentException – if
time
doesn’t match “HHMM” pattern
Returns: the instance of
Time
- time – the