public abstract class STAbstractDate<T extends STAbstractInstant<T>> extends STAbstractInstant<T>
Modifier and Type | Field and Description |
---|---|
static int |
MAX_ALLOWED_YEAR
Maximum allowed year value in Secutix.
|
dateTime, FORMAT_PATTERN_DATE_ISO, FORMAT_PATTERN_DATETIME_ISO, FORMAT_PATTERN_TIME_ISO
Constructor and Description |
---|
STAbstractDate() |
Modifier and Type | Method and Description |
---|---|
T |
addDay(int value) |
T |
addMonth(int value) |
T |
addYear(int value) |
int |
compareTo(T o)
Compares 2 date objects.
|
int |
getDay() |
T |
getFirstDateOfMonth()
Returns the first date of current month and year.
|
T |
getLastDateOfMonth()
Returns the last date of current month and year.
|
int |
getMonth() |
WeekDayEnum |
getWeekday() |
int |
getYear() |
abstract boolean |
isFutureInfinity()
Checks if current date/time is considered the 'future-infinite'.
|
abstract boolean |
isPastInfinity()
Checks if current date/time is considered the 'past-infinite'.
|
boolean |
isSet()
Checks if current date is set.
|
T |
substractDay(int value) |
T |
substractMonth(int value) |
T |
substractYear(int value) |
T |
tomorrow()
Returns a new date/time whose value is 1-day after current date/time.
|
T |
yesterday()
Returns a new date/time whose value is 1-day before current date/time.
|
clone, createCalendar, equals, hashCode, isAfter, isAfterOrEqual, isBefore, isBeforeOrEqual, isBetween, isSet, rawAdd, rawSubstract, reset, setDateFields, setTimeFields, toIsoDateTimeString, toString, toString, toString
public static final int MAX_ALLOWED_YEAR
public abstract boolean isPastInfinity()
true
if current date/time is considered the 'past-infinite'.public abstract boolean isFutureInfinity()
true
if current date/time is considered the 'future-infinite'.public T getLastDateOfMonth()
public T getFirstDateOfMonth()
public WeekDayEnum getWeekday()
public boolean isSet()
Remark: A date is set if it's after 'past-infinite' and before 'future-infinite'.
isSet
in class STAbstractInstant<T extends STAbstractInstant<T>>
true
if current date is set.public int compareTo(T o)
Remarks: null
values are always before not-null values. Past-infinity is considered the
smallest date value (but bigger than null
) and future-infinity is considered the biggest one.
compareTo
in interface Comparable<T extends STAbstractInstant<T>>
compareTo
in class STAbstractInstant<T extends STAbstractInstant<T>>
o
- A date object comparing with this object.public T tomorrow()
public T yesterday()
public int getYear()
public int getMonth()
public int getDay()
public T addDay(int value)
public T addMonth(int value)
public T addYear(int value)
public T substractDay(int value)
public T substractMonth(int value)
public T substractYear(int value)
Copyright © 2021. All rights reserved.