Package ch.nolix.system.time.moment
Klasse Time
java.lang.Object
ch.nolix.system.element.base.Element
ch.nolix.system.time.moment.Time
Time
stores a point in time with a precision of 1 millisecond. A
Time
is not mutable. Technically, a Time
is a wrapper around
a JDK's ZonedDateTime
.- Version:
- 2016-09-01
- Autor:
- Silvan Wyss
-
Feldübersicht
Modifizierer und TypFeldBeschreibungstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic Time
fromSpecification
(INode<?> specification) static Time
fromString
(String string) IContainer
<INode<?>> getDay()
int
int
This method returns a negative value if the currentTime
is after the given time.getHour()
int
int
long
long
getMillisecondsTo
(ITime time) This method returns a negative value if the currentTime
is after the given time.int
getMonth()
int
int
getWithAddedOrSubtractedDays
(int days) getWithAddedOrSubtractedHours
(int hours) getWithAddedOrSubtractedMilliseconds
(int milliseconds) getWithAddedOrSubtractedMinutes
(int minutes) getWithAddedOrSubtractedSeconds
(int seconds) getYear()
int
boolean
boolean
boolean
static Time
ofNow()
static Time
withYear
(int year) static Time
withYearAndMonthOfYear
(int year, int monthOfYear) static Time
withYearAndMonthOfYearAndDayOfMonth
(int year, int monthOfYear, int dayOfMonth) static Time
withYearAndMonthOfYearAndDayOfMonthAndHourOfDay
(int year, int monthOfYear, int dayOfMonth, int hourOfDay) static Time
withYearAndMonthOfYearAndDayOfMonthAndHourOfDayAndMinuteOfHour
(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour) static Time
withYearAndMonthOfYearAndDayOfMonthAndHourOfDayAndMinuteOfHourAndSecondOfMinute
(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute) static Time
withYearAndMonthOfYearAndDayOfMonthAndHourOfDayAndMinuteOfHourAndSecondOfMinuteAndMillisecondOfSecond
(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisecondOfSecond) Von Klasse geerbte Methoden ch.nolix.system.element.base.Element
equals, getSpecification, hashCode, toString
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.nolix.systemapi.elementapi.baseapi.IElement
getSpecification, toFormatedString, toXml
-
Felddetails
-
DEFAULT_YEAR
public static final int DEFAULT_YEAR- Siehe auch:
-
DEFAULT_MONTH_OF_YEAR
public static final int DEFAULT_MONTH_OF_YEAR- Siehe auch:
-
DEFAULT_DAY_OF_MONTH
public static final int DEFAULT_DAY_OF_MONTH- Siehe auch:
-
DEFAULT_HOUR_OF_DAY
public static final int DEFAULT_HOUR_OF_DAY- Siehe auch:
-
DEFAULT_MINUTE_OF_HOUR
public static final int DEFAULT_MINUTE_OF_HOUR- Siehe auch:
-
DEFAULT_SECOND_OF_MINUTE
public static final int DEFAULT_SECOND_OF_MINUTE- Siehe auch:
-
DEFAULT_MILLISECOND_OF_SECOND
public static final int DEFAULT_MILLISECOND_OF_SECOND- Siehe auch:
-
-
Methodendetails
-
fromSpecification
- Parameter:
specification
-- Gibt zurück:
- a new
Time
from the given specification. - Löst aus:
InvalidArgumentException
- if the given specification is not valid.
-
fromString
- Parameter:
string
-- Gibt zurück:
- a new
Time
from the given string. - Löst aus:
ArgumentIsNullException
- if the given string is null.
-
ofNow
- Gibt zurück:
- a new
Time
that represents the current time on the local computer.
-
withYear
- Parameter:
year
-- Gibt zurück:
- a new
Time
with the given year.
-
withYearAndMonthOfYear
- Parameter:
year
-monthOfYear
-- Gibt zurück:
- a new
Time
with the given year and monthOfYear.
-
withYearAndMonthOfYearAndDayOfMonth
- Parameter:
year
-monthOfYear
-dayOfMonth
-- Gibt zurück:
- a new
Time
with the given year, monthOfYear and dayOfMonth.
-
withYearAndMonthOfYearAndDayOfMonthAndHourOfDay
public static Time withYearAndMonthOfYearAndDayOfMonthAndHourOfDay(int year, int monthOfYear, int dayOfMonth, int hourOfDay) - Parameter:
year
-monthOfYear
-dayOfMonth
-hourOfDay
-- Gibt zurück:
- a new
Time
with the given year, monthOfYear, dayOfMonth and hourOfDay.
-
withYearAndMonthOfYearAndDayOfMonthAndHourOfDayAndMinuteOfHour
public static Time withYearAndMonthOfYearAndDayOfMonthAndHourOfDayAndMinuteOfHour(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour) - Parameter:
year
-monthOfYear
-dayOfMonth
-hourOfDay
-minuteOfHour
-- Gibt zurück:
- a new
Time
with the given year, monthOfYear, dayOfMonth, hourOfDay and minuteOfHour.
-
withYearAndMonthOfYearAndDayOfMonthAndHourOfDayAndMinuteOfHourAndSecondOfMinute
public static Time withYearAndMonthOfYearAndDayOfMonthAndHourOfDayAndMinuteOfHourAndSecondOfMinute(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute) - Parameter:
year
-monthOfYear
-dayOfMonth
-hourOfDay
-minuteOfHour
-secondOfMinute
-- Gibt zurück:
- a new
Time
with the given year, monthOfYear, dayOfMonth, hourOfDay, minuteOfHour and secondOfMinute.
-
withYearAndMonthOfYearAndDayOfMonthAndHourOfDayAndMinuteOfHourAndSecondOfMinuteAndMillisecondOfSecond
public static Time withYearAndMonthOfYearAndDayOfMonthAndHourOfDayAndMinuteOfHourAndSecondOfMinuteAndMillisecondOfSecond(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisecondOfSecond) - Parameter:
year
-monthOfYear
-dayOfMonth
-hourOfDay
-minuteOfHour
-secondOfMinute
-millisecondOfSecond
-- Gibt zurück:
- a new
Time
with the given year, monthOfYear, dayOfMonth, hourOfDay, minuteOfHour, secondOfMinute and millisecondOfSecond.
-
getAttributes
- Angegeben von:
getAttributes
in SchnittstelleIElement
- Gibt zurück:
- the attributes of the current
IElement
.
-
getDay
- Gibt zurück:
- the day of the current
Time
.
-
getDayOfMonth
public int getDayOfMonth()- Gibt zurück:
- the day of the month of the current
Time
.
-
getDaysTo
This method returns a negative value if the currentTime
is after the given time.- Parameter:
time
-- Gibt zurück:
- the number of days from the current
Time
to the given time.
-
getHour
- Gibt zurück:
- the hour of the current
Time
.
-
getHourOfDay
public int getHourOfDay()- Gibt zurück:
- the hour of the month of the current
Time
.
-
getMilliseconds
public long getMilliseconds()- Angegeben von:
getMilliseconds
in SchnittstelleITime
- Gibt zurück:
- the milliseconds of the current
ITime
.
-
getMillisecondOfSecond
public int getMillisecondOfSecond()- Gibt zurück:
- the millisecond of the second of the current
Time
.
-
getMillisecondsTo
This method returns a negative value if the currentTime
is after the given time.- Parameter:
time
-- Gibt zurück:
- the number of milliseconds from the current
Time
to the given time.
-
getMinute
- Gibt zurück:
- the minute of the current
Time
.
-
getMinuteOfHour
public int getMinuteOfHour()- Gibt zurück:
- the minute of the hour of the current
Time
.
-
getMonth
- Gibt zurück:
- the month of the current
Time
.
-
getMonthOfYear
- Angegeben von:
getMonthOfYear
in SchnittstelleITime
- Gibt zurück:
- the month of the year of the current
ITime
.
-
getMonthOfYearAsInt
public int getMonthOfYearAsInt()- Gibt zurück:
- the month of the year of the current
Time
.
-
getNextDay
- Gibt zurück:
- the next day of the current
Time
.
-
getNextHour
- Gibt zurück:
- the next hour of the current
Time
.
-
getNextMinute
- Gibt zurück:
- the next minute of the current
Time
.
-
getNextMonth
- Gibt zurück:
- the next month of the current
Time
.
-
getNextSecond
- Gibt zurück:
- the next second of the current
Time
.
-
getNextYear
- Gibt zurück:
- the next year of the current
Time
.
-
getSecond
- Gibt zurück:
- the second of the current
Time
.
-
getSecondOfMinute
public int getSecondOfMinute()- Gibt zurück:
- the second of the minute of the current
Time
.
-
getWeekday
- Angegeben von:
getWeekday
in SchnittstelleITime
- Gibt zurück:
- the weekday of the current
ITime
.
-
getWithAddedOrSubtractedDays
-
getWithAddedOrSubtractedHours
-
getWithAddedOrSubtractedMilliseconds
-
getWithAddedOrSubtractedMinutes
-
getWithAddedOrSubtractedSeconds
-
getYear
- Gibt zurück:
- the year of the current
Time
.
-
getYearAsInt
public int getYearAsInt()- Gibt zurück:
- the year of the current
Time
.
-
isAfter
-
isBefore
-
isInLeapYear
public boolean isInLeapYear()- Gibt zurück:
- true if the current
Time
is in a leap year.
-