public class PackedLocalTime
extends java.lang.Object
The bytes are packed into the int as: First byte: hourOfDay next byte: minuteOfHour last two bytes (short): millisecond of minute
Storing the millisecond of minute in an short requires that we treat the short as if it were unsigned. Unfortunately, Neither Java nor Guava provide unsigned short support so we use char, which is a 16-bit unsigned int to store values of up to 60,000 milliseconds (60 secs * 1000)
Constructor and Description |
---|
PackedLocalTime() |
Modifier and Type | Method and Description |
---|---|
static boolean |
AM(int packedTime)
Returns true if the time is in the AM or "before noon".
|
static java.time.LocalTime |
asLocalTime(int time) |
static byte |
getHour(int time) |
static int |
getMillisecondOfDay(int packedLocalTime) |
static char |
getMillisecondOfMinute(int time) |
static int |
getMilliseconds(int time) |
static byte |
getMinute(int time) |
static int |
getMinuteOfDay(int packedLocalTime) |
static int |
getNano(int time) |
static byte |
getSecond(int packedLocalTime) |
static int |
getSecondOfDay(int packedLocalTime) |
static boolean |
isAfter(int packedTime,
int value) |
static boolean |
isBefore(int packedTime,
int value) |
static boolean |
isEqualTo(int packedTime,
int value) |
static boolean |
isMidnight(int packedTime) |
static boolean |
isNoon(int packedTime) |
static int |
pack(java.time.LocalTime time) |
static boolean |
PM(int packedTime)
Returns true if the time is in the PM or "after noon".
|
static long |
toNanoOfDay(int time) |
static java.lang.String |
toShortTimeString(int time) |
public static byte getHour(int time)
public static char getMillisecondOfMinute(int time)
public static int getNano(int time)
public static int getMilliseconds(int time)
public static long toNanoOfDay(int time)
public static java.time.LocalTime asLocalTime(int time)
public static byte getMinute(int time)
public static int pack(java.time.LocalTime time)
public static byte getSecond(int packedLocalTime)
public static int getMinuteOfDay(int packedLocalTime)
public static int getSecondOfDay(int packedLocalTime)
public static int getMillisecondOfDay(int packedLocalTime)
public static java.lang.String toShortTimeString(int time)
public static boolean isMidnight(int packedTime)
public static boolean isNoon(int packedTime)
public static boolean isAfter(int packedTime, int value)
public static boolean isBefore(int packedTime, int value)
public static boolean isEqualTo(int packedTime, int value)
public static boolean AM(int packedTime)
public static boolean PM(int packedTime)