Class Time
java.lang.Object
ch.nolix.system.element.base.AbstractElement
ch.nolix.system.time.moment.Time
- Author:
- Silvan Wyss
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionstatic TimeforZonedDateTime(ZonedDateTime zonedDateTime) static TimefromSpecification(INode<?> specification) static TimefromString(String string) IContainer<INode<?>> intintintintintintintintintgetYear()booleanbooleanbooleanstatic TimeofNow()longwithAddedOrSubtractedDays(int days) withAddedOrSubtractedHours(int hours) withAddedOrSubtractedMicroseconds(long microseconds) withAddedOrSubtractedMilliseconds(int milliseconds) withAddedOrSubtractedMinutes(int minutes) withAddedOrSubtractedSeconds(int seconds) static TimewithYear(int year) static TimewithYearAndMonthOfYear(int year, int monthOfYear) static TimewithYearAndMonthOfYearAndDayOfMonth(int year, int monthOfYear, int dayOfMonth) static TimewithYearAndMonthOfYearAndDayOfMonthAndHourOfDay(int year, int monthOfYear, int dayOfMonth, int hourOfDay) static TimewithYearAndMonthOfYearAndDayOfMonthAndHourOfDayAndMinOfHour(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour) static TimewithYearAndMonthOfYearAndDayOfMonthAndHourOfDayAndMinOfHourAndSecOfMin(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute) static TimewithYearAndMonthOfYearAndDayOfMonthAndHourOfDayAndMinOfHourAndSecOfMinAndMillisecOfSec(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisecondOfSecond) static TimewithYearAndMonthOfYearAndDayOfMonthAndHourOfDayAndMinOfHourAndSecOfMinAndMillisecOfSecAndMicrosecOfMillisec(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisecondOfSecond, int microsecondsOfMilliSecond) Methods inherited from class AbstractElement
equals, getSpecification, hashCode, toStringMethods inherited from interface IElement
getSpecification, toFormatedString, toXml
-
Field Details
-
DEFAULT_YEAR
public static final int DEFAULT_YEAR- See Also:
-
DEFAULT_MONTH_OF_YEAR
public static final int DEFAULT_MONTH_OF_YEAR- See Also:
-
DEFAULT_DAY_OF_MONTH
public static final int DEFAULT_DAY_OF_MONTH- See Also:
-
DEFAULT_HOUR_OF_DAY
public static final int DEFAULT_HOUR_OF_DAY- See Also:
-
DEFAULT_MINUTE_OF_HOUR
public static final int DEFAULT_MINUTE_OF_HOUR- See Also:
-
DEFAULT_SECOND_OF_MINUTE
public static final int DEFAULT_SECOND_OF_MINUTE- See Also:
-
DEFAULT_MILLISECOND_OF_SECOND
public static final int DEFAULT_MILLISECOND_OF_SECOND- See Also:
-
DEFAULT_MICROSECOND_OF_MILLISECOND
public static final int DEFAULT_MICROSECOND_OF_MILLISECOND- See Also:
-
-
Method Details
-
forZonedDateTime
- Parameters:
zonedDateTime-- Returns:
- a new
Timefor the given zonedDateTime. - Throws:
RuntimeException- if the given zonedDateTime is null.
-
fromSpecification
- Parameters:
specification-- Returns:
- a new
Timefrom the given specification. - Throws:
NullPointerException- if the given specification is null.RuntimeException- if the given specification does not represent aTime.
-
fromString
- Parameters:
string-- Returns:
- a new
Timefrom the given string. - Throws:
RuntimeException- if the given string does not represent aTime.
-
ofNow
-
withYear
-
withYearAndMonthOfYear
-
withYearAndMonthOfYearAndDayOfMonth
-
withYearAndMonthOfYearAndDayOfMonthAndHourOfDay
-
withYearAndMonthOfYearAndDayOfMonthAndHourOfDayAndMinOfHour
public static Time withYearAndMonthOfYearAndDayOfMonthAndHourOfDayAndMinOfHour(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour) - Parameters:
year-monthOfYear-dayOfMonth-hourOfDay-minuteOfHour-- Returns:
- a new
Timewith the given year, monthOfYear, dayOfMonth, hourOfDay and minuteOfHour.
-
withYearAndMonthOfYearAndDayOfMonthAndHourOfDayAndMinOfHourAndSecOfMin
public static Time withYearAndMonthOfYearAndDayOfMonthAndHourOfDayAndMinOfHourAndSecOfMin(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute) - Parameters:
year-monthOfYear-dayOfMonth-hourOfDay-minuteOfHour-secondOfMinute-- Returns:
- a new
Timewith the given year, monthOfYear, dayOfMonth, hourOfDay, minuteOfHour and secondOfMinute.
-
withYearAndMonthOfYearAndDayOfMonthAndHourOfDayAndMinOfHourAndSecOfMinAndMillisecOfSec
public static Time withYearAndMonthOfYearAndDayOfMonthAndHourOfDayAndMinOfHourAndSecOfMinAndMillisecOfSec(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisecondOfSecond) - Parameters:
year-monthOfYear-dayOfMonth-hourOfDay-minuteOfHour-secondOfMinute-millisecondOfSecond-- Returns:
- a new
Timewith the given year, monthOfYear, dayOfMonth, hourOfDay, minuteOfHour, secondOfMinute and millisecondOfSecond.
-
withYearAndMonthOfYearAndDayOfMonthAndHourOfDayAndMinOfHourAndSecOfMinAndMillisecOfSecAndMicrosecOfMillisec
public static Time withYearAndMonthOfYearAndDayOfMonthAndHourOfDayAndMinOfHourAndSecOfMinAndMillisecOfSecAndMicrosecOfMillisec(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisecondOfSecond, int microsecondsOfMilliSecond) - Parameters:
year-monthOfYear-dayOfMonth-hourOfDay-minuteOfHour-secondOfMinute-millisecondOfSecond-microsecondsOfMilliSecond-- Returns:
- a new
Timewith the given year, monthOfYear, dayOfMonth, hourOfDay, minuteOfHour, secondOfMinute and millisecondOfSecond.
-
getAttributes
- Specified by:
getAttributesin interfaceIElement- Returns:
- the attributes of the current
IElement.
-
getDayOfMonth
public int getDayOfMonth()- Specified by:
getDayOfMonthin interfaceITime- Returns:
- the day of the month of the current
ITime.
-
getHourOfDay
public int getHourOfDay()- Specified by:
getHourOfDayin interfaceITime- Returns:
- the hour of the day of the current
ITime.
-
getMicrosecondOfMillisecond
public int getMicrosecondOfMillisecond()- Specified by:
getMicrosecondOfMillisecondin interfaceITime- Returns:
- the microsecond of the millisecond of the current
ITime.
-
getMillisecondOfSecond
public int getMillisecondOfSecond()- Specified by:
getMillisecondOfSecondin interfaceITime- Returns:
- the millisecond of the second of the current
ITime.
-
getMinuteOfHour
public int getMinuteOfHour()- Specified by:
getMinuteOfHourin interfaceITime- Returns:
- the minute of the hour of the current
ITime.
-
getMonthOfYear
- Specified by:
getMonthOfYearin interfaceITime- Returns:
- the month of the year of the current
ITime.
-
getMonthOfYearAsInt
public int getMonthOfYearAsInt()- Specified by:
getMonthOfYearAsIntin interfaceITime- Returns:
- the month of the year of the current
ITimeas int.
-
getSecondOfMinute
public int getSecondOfMinute()- Specified by:
getSecondOfMinutein interfaceITime- Returns:
- the second of the minute of the current
ITime.
-
getWeekday
- Specified by:
getWeekdayin interfaceITime- Returns:
- the weekday of the current
ITime.
-
getWeekOfYear
public int getWeekOfYear()- Specified by:
getWeekOfYearin interfaceITime- Returns:
- the week of the year of the current
ITime.
-
getYear
-
isAfter
-
isBefore
-
isInLeapYear
public boolean isInLeapYear()- Specified by:
isInLeapYearin interfaceITime- Returns:
- true if the current
ITimeis in a leap year, false otherwise.
-
toSeconds
-
withAddedOrSubtractedDays
- Specified by:
withAddedOrSubtractedDaysin interfaceITime- Parameters:
days-- Returns:
- a new
ITimewith the given days added to or subtracted from the currentITime.
-
withAddedOrSubtractedHours
- Specified by:
withAddedOrSubtractedHoursin interfaceITime- Parameters:
hours-- Returns:
- a new
ITimewith the given hours added to or subtracted from the currentITime.
-
withAddedOrSubtractedMicroseconds
- Specified by:
withAddedOrSubtractedMicrosecondsin interfaceITime- Parameters:
microseconds-- Returns:
- a new
ITimewith the given microseconds added to or subtracted from the currentITime.
-
withAddedOrSubtractedMilliseconds
- Specified by:
withAddedOrSubtractedMillisecondsin interfaceITime- Parameters:
milliseconds-- Returns:
- a new
ITimewith the given milliseconds added to or subtracted from to the currentITime.
-
withAddedOrSubtractedMinutes
- Specified by:
withAddedOrSubtractedMinutesin interfaceITime- Parameters:
minutes-- Returns:
- a new
ITimewith the given minutes added to or subtracted from the currentITime.
-
withAddedOrSubtractedSeconds
- Specified by:
withAddedOrSubtractedSecondsin interfaceITime- Parameters:
seconds-- Returns:
- a new
ITimewith the given seconds added to or subtracted from the currentITime.
-