public class EdbDate extends Object implements Comparable<EdbDate>, Cloneable
Modifier and Type | Class and Description |
---|---|
static class |
EdbDate.FMT |
Modifier and Type | Field and Description |
---|---|
protected int |
date |
static int |
DATE_MAX |
static int |
DATE_MIN |
Constructor and Description |
---|
EdbDate(int d)
指定された日付で,新しいインスタンスを初期化します.
|
EdbDate(int y,
int m,
int d)
指定された年月日で,新しいインスタンスを初期化します.
|
EdbDate(String s)
指定された日付で,新しいインスタンスを初期化します.
|
EdbDate(UDate udate)
指定された年月日で,新しいインスタンスを初期化します.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(EdbDate d) |
int |
compareTo(int d)
このオブジェクトが表す日付と指定された日付を比較します.
|
int |
day()
Retrieve day of this object.
|
static int |
day(int d)
指定された日付 d から日を取得します.
|
EdbDate |
duplicate()
このオブジェクトの複製を作成します.
|
boolean |
equals(EdbDate d)
このオブジェクトが表す日付と等しいかどうか判定します.
|
boolean |
equals(int d)
このオブジェクトが表す日付と等しいかどうか判定します.
|
int |
getCivilYear()
Retrieve civil year of this object.
|
static int |
getCivilYear(int d)
Retrieve year of specified date.
|
int |
getFiscalYear()
Retrieve fiscal year of this object.
|
static int |
getFiscalYear(int d)
Retrieve fiscal year.
|
int |
hashCode()
このオブジェクトのハッシュコードを取得します.
|
static int |
HMS(int h,
int m,
int s)
指定された時分秒を表す時刻を取得します.
|
static int |
hour(int t)
時刻から時を取得します.
|
int |
intValue()
このオブジェクトが表す日付を
int 型で取得します. |
static int |
intValue(String s)
数字で表された日付を
int 型に変換します. |
boolean |
isFuture(int f,
int t)
このオブジェクトが表す日付より指定された期間が未来にあるかどうか判定します.
|
static boolean |
isFuture(int d,
int f,
int t)
指定された日付 d より指定された期間が未来にあるかどうか判定します.
|
boolean |
isInner(EdbDate2 p)
このオブジェクトが表す日付が指定された期間の内にあるかどうか判定します.
|
boolean |
isInner(EdbDate f,
EdbDate t)
このオブジェクトが表す日付が指定された期間の内にあるかどうか判定します.
|
boolean |
isInner(int f,
int t)
このオブジェクトが表す日付が指定された期間の内にあるかどうか判定します.
|
static boolean |
isInner(int d,
int f,
int t)
指定された日付 d が指定された期間の内にあるかどうか判定します.
|
static boolean |
isOverlap(EdbDate f1,
EdbDate t1,
EdbDate f2,
EdbDate t2)
指定された期間が重なる部分をもつかどうかを判定します.
|
static boolean |
isOverlap(int f1,
int t1,
int f2,
int t2)
指定された期間が重なる部分をもつかどうかを判定します.
|
boolean |
isPast(int f,
int t)
このオブジェクトが表す日付より指定された期間が過去にあるかどうか判定します.
|
static boolean |
isPast(int d,
int f,
int t)
指定された日付 d より指定された期間が過去にあるかどうか判定します.
|
boolean |
isUsable()
このオブジェクトが表す日付が有効かどうかを判定します.
|
static boolean |
isUsable(int date)
指定された日付 date が有効かどうかを判定します.
|
static int |
minute(int t)
時刻から分を取得します.
|
int |
month()
Retrieve month of this object.
|
static int |
month(int d)
指定された日付 d から月を取得します.
|
static int |
round(int date)
日付の範囲の範囲外にある日付を,その範囲の最も近い値に丸めます.
|
static int |
second(int t)
時刻から秒を取得します.
|
String |
toADString()
このオブジェクトが表す日付を西暦の文字列に変換します.
|
String |
toADYMString()
このオブジェクトが表す日付を西暦の文字列に変換します.
|
static EdbDate |
today()
現在の日付を取得します.
|
CharSequence |
toISO8601()
ISO8601準拠の日付フォーマットに変換する.
|
static CharSequence |
toISO8601(EdbDate date)
ISO8601準拠の日付フォーマットに変換する.
|
String |
toJEraString()
このオブジェクトが表す日付を和暦の文字列に変換します.
|
String |
toJEraYearString()
このオブジェクトが表す日付を和暦の年の文字列に変換します.
|
String |
toJEraYMString()
このオブジェクトが表す日付を和暦の文字列に変換します.
|
LocalDateTime |
toLocalDateTime()
Convert to LocalDateTime.
|
String |
toString()
このオブジェクトが表す日付を数字の文字列に変換します.
|
static String |
toString(int date)
指定された日付 date を数字の文字列に変換します.
|
String |
toText(EdbDate.FMT fmt)
このオブジェクトが表す日付を指定されたフォーマットの文字列に変換します.
|
UDate |
toUDate()
Convert to Udate.
|
int |
year()
Retrieve year.
|
static int |
year(int d)
Retrieve year of specified date.
|
static int |
YMD(int y,
int m,
int d)
指定された年月日を表す日付を取得します.
|
public static final int DATE_MIN
public static final int DATE_MAX
protected int date
public EdbDate(int d)
d
- 日付public EdbDate(String s)
s
- 日付public EdbDate(int y, int m, int d)
y
- 年m
- 月d
- 日public EdbDate(UDate udate)
udate
- UDatepublic EdbDate duplicate()
public static int intValue(String s)
int
型に変換します.s
- 日付int
型でその日付を返します.失敗した場合は,0
を返します.public int intValue()
int
型で取得します.int
型で返します.public static String toString(int date)
変換される形式は次のようになります.
yyyymmdd yyyy ... 年を表す 4 文字の数字 mm ... 月を表す 2 文字の数字 dd ... 日を表す 2 文字の数字
date
- 日付public String toString()
変換される形式は次のようになります.
yyyymmdd yyyy ... 年を表す 4 文字の数字 mm ... 月を表す 2 文字の数字 dd ... 日を表す 2 文字の数字
public CharSequence toISO8601()
public static CharSequence toISO8601(EdbDate date)
date
- date.public String toADString()
変換される形式は次のようになります.
西暦y年m月d日 y ... 年 m ... 月 d ... 日また,変換の際に特定の月・日は,次の文字に置き換わります.
0月 ... 初月 99月 ... 末月 0日 ... 初日 99日 ... 末日
public String toADYMString()
変換される形式は次のようになります.
西暦y年m月 y ... 年 m ... 月また,変換の際に特定の月・日は,次の文字に置き換わります.
0月 ... 初月 99月 ... 末月
public String toJEraString()
変換される形式は次のようになります.
e年m月d日 e ... 年号と年 m ... 月 d ... 日また,変換の際に特定の年・月・日は,次の文字に置き換わります.
1年 ... 元日 0月 ... 初月 99月 ... 末月 0日 ... 初日 99日 ... 末日日付の年が明治以前の場合は,西暦に変換されます.
public String toJEraYMString()
変換される形式は次のようになります.
e年m月 e ... 年号と年 m ... 月また,変換の際に特定の年・月・日は,次の文字に置き換わります.
1年 ... 元日 0月 ... 初月 99月 ... 末月日付の年が明治以前の場合は,西暦に変換されます.
public String toJEraYearString()
変換される形式は次のようになります.
e年 e ... 年号と年また,変換の際に特定の年は,次の文字に置き換わります.
1年 ... 元年日付の年が明治以前の場合は,西暦に変換されます.
public static final boolean isUsable(int date)
このメソッドは,日付が有効な範囲の値( DATE_MIN
より上,DATE_MAX
より下の値)かどうかを調べます.
public boolean isUsable()
このメソッドは,日付が有効な範囲の値( DATE_MIN
より上,DATE_MAX
より下の値)かどうかを調べます.
public static final int round(int date)
このメソッドは,日付が DATE_MIN
より小さい値の場合は DATE_MIN
に,
DATE_MAX
より大きい値の場合は DATE_MAX
に丸めます.
public static final int year(int d)
d
- datepublic final int year()
public static final int getCivilYear(int d)
d
- datepublic final int getCivilYear()
public static final int getFiscalYear(int d)
d
- datepublic final int getFiscalYear()
public static final int month(int d)
d
- 日付public final int month()
public static final int day(int d)
d
- 日付public final int day()
public static final int YMD(int y, int m, int d)
y
- yearm
- monthd
- daypublic static EdbDate today()
public static final int hour(int t)
t
- 時刻public static final int minute(int t)
t
- 時刻public static final int second(int t)
t
- 時刻public static final int HMS(int h, int m, int s)
h
- 時m
- 分s
- 秒public static final boolean isInner(int d, int f, int t)
d
- 日付f
- 期間(始まり)t
- 期間(終わり)true
,その他 false
を返します.public final boolean isInner(int f, int t)
f
- 期間(始まり)t
- 期間(終わり)true
,その他 false
を返します.public final boolean isInner(EdbDate f, EdbDate t)
f
- 期間(始まり)t
- 期間(終わり)true
,その他 false
を返します.public final boolean isInner(EdbDate2 p)
p
- 期間true
,その他 false
を返します.public static final boolean isFuture(int d, int f, int t)
d
- 日付f
- 期間(始まり)t
- 期間(終わり)true
,その他 false
を返します.public final boolean isFuture(int f, int t)
f
- 期間(始まり)t
- 期間(終わり)true
,その他 false
を返します.public static final boolean isPast(int d, int f, int t)
d
- 日付f
- 期間(始まり)t
- 期間(終わり)true
,その他 false
を返します.public final boolean isPast(int f, int t)
f
- 期間(始まり)t
- 期間(終わり)true
,その他 false
を返します.public static final boolean isOverlap(int f1, int t1, int f2, int t2)
f1
- 期間 1 (始まり)t1
- 期間 1 (終わり)f2
- 期間 2 (始まり)t2
- 期間 2 (終わり)true
,その他 false
を返します.public static final boolean isOverlap(EdbDate f1, EdbDate t1, EdbDate f2, EdbDate t2)
f1
- 期間 1 (始まり)t1
- 期間 1 (終わり)f2
- 期間 2 (始まり)t2
- 期間 2 (終わり)true
,その他 false
を返します.public final boolean equals(EdbDate d)
d
- 日付true
,その他 false
を返します.public final boolean equals(int d)
d
- 日付true
,その他 false
を返します.public final int hashCode()
ここでは,日付をハッシュコードとして戻しています.
public final int compareTo(EdbDate d)
compareTo
in interface Comparable<EdbDate>
public final int compareTo(int d)
d
- 日付public final String toText(EdbDate.FMT fmt)
fmt
- フォーマット,フォーマットの定数の値を指定EdbDate.FMT
public UDate toUDate()
public LocalDateTime toLocalDateTime()
EDB Working Group at Tue Jun 10 17:08:59 JST 2025