Class LocalTime
java.lang.Object
java.time.LocalTime
- All Implemented Interfaces:
Comparable<LocalTime>, TemporalAccessor
public final class LocalTime
extends java.lang.Object
implements Comparable<LocalTime>, TemporalAccessor
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintCompares this object to the specified object to determine their relative order.booleanequals(java.lang.Object obj) format(DateTimeFormatter formatter) intgetHour()intintgetNano()intinthashCode()static LocalTimenow()static LocalTimestatic LocalTimeof(int hour, int minute) static LocalTimeof(int hour, int minute, int second) static LocalTimeof(int hour, int minute, int second, int nano) static LocalTimeofNanoOfDay(long nanoOfDay) static LocalTimeofSecondOfDay(long secondOfDay) static LocalTimeparse(CharSequence text) static LocalTimeparse(CharSequence text, DateTimeFormatter formatter) plusHours(long hoursToAdd) plusMinutes(long minutesToAdd) plusSeconds(long secondsToAdd) longinttoString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Field Details
-
MIDNIGHT
-
-
Method Details
-
now
-
now
-
of
-
of
-
of
-
ofSecondOfDay
-
ofNanoOfDay
-
parse
-
parse
-
getHour
public int getHour() -
getMinute
public int getMinute() -
getSecond
public int getSecond() -
getNano
public int getNano() -
toSecondOfDay
public int toSecondOfDay() -
toNanoOfDay
public long toNanoOfDay() -
plusHours
-
plusMinutes
-
plusSeconds
-
format
-
compareTo
Description copied from interface:ComparableCompares this object to the specified object to determine their relative order.
Parameters
another: the object to compare to this instance.
Returns
- Specified by:
compareToin interfaceComparable<LocalTime>- Returns:
a negative integer if this instance is less than
another; a positive integer if this instance is greater thananother; 0 if this instance has the same order asanother.Throws
ClassCastException: @throws ClassCastException ifanothercannot be converted into something comparable tothisinstance.
-
equals
public boolean equals(java.lang.Object obj) - Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
toString
- Overrides:
toStringin classjava.lang.Object
-