public class Time
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Time.Unit
Units to be used in
Time-mathemathics. |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_TIME_FORMAT
A time-format-pattern to be used for formatting, if no other is defined.
|
| Modifier and Type | Method and Description |
|---|---|
Time |
add(long amountToAdd,
Time.Unit unit)
Changes a current value of an object for
amountToAdd units of unit |
int |
compareTo(Time other)
Compares an object with another
Time-object. |
boolean |
equals(java.lang.Object other)
Compares an object to another
Time object. |
int |
getHour() |
int |
getMillisecond() |
int |
getMinute() |
int |
getNano() |
int |
getSecond() |
int |
hashCode()
Hashcode of an object.
Hashcode of an object will be a hashcode of its value-container object value |
static Time |
noon()
Creating a noon time
|
static Time |
now()
Creating an object with a current time
|
static Time |
of(java.time.LocalTime localTime)
Creating a time from a
LocalTime |
static Time |
of(Time time)
|
java.time.LocalTime |
toLocalTime()
Converts an object to
LocalTime. |
java.lang.String |
toString()
Converts to
String, using DEFAULT_FORMATTER. |
java.lang.String |
toString(java.time.format.DateTimeFormatter formatter)
Converts to
String, using formatter. |
java.lang.String |
toString(java.util.Locale locale)
Converts to
String, using locale. |
java.lang.String |
toString(java.lang.String formatDescription)
Converts to
String, using a DateTimeFormatter defined by formatDescription. |
static Time |
zero()
Creating a zero time
|
public static final java.lang.String DEFAULT_TIME_FORMAT
public static Time of(java.time.LocalTime localTime)
LocalTimepublic static Time now()
Time objectpublic int getHour()
Time-objectpublic int getMinute()
Time-object.public int getSecond()
Time-object.public int getMillisecond()
public int getNano()
Time-object.public Time add(long amountToAdd, Time.Unit unit)
amountToAdd units of unitamountToAdd - quantity of unit to be added (or subtracted, if amountToAdd is negative} to a current object.unit - Chrono-unit of measureTime-objectpublic java.time.LocalTime toLocalTime()
LocalTime.LocalTime value of an object.public java.lang.String toString()
String, using DEFAULT_FORMATTER.toString in class java.lang.Objectpublic java.lang.String toString(java.time.format.DateTimeFormatter formatter)
String, using formatter.
If formatter is null, then a standard toString() is used.formatter - A format to be used when formatting a timepublic java.lang.String toString(java.util.Locale locale)
String, using locale.
If locale is null, then a standard DEFAULT_LOCALE is used.locale - A locale to be used when formatting a timepublic java.lang.String toString(java.lang.String formatDescription)
String, using a DateTimeFormatter defined by formatDescription.formatDescription - A String-definition of a DateTimeFormatter to be used when formatting a timepublic int hashCode()
valuehashCode in class java.lang.Object