Class ChineseTime
java.lang.Object
org.episteme.social.history.time.Time
org.episteme.social.history.clock.ChineseTime
- All Implemented Interfaces:
Serializable
Represents Traditional Chinese Time.
Historically, the day was divided into 100 components called 'ke' (刻).
Each 'ke' was subdivided into 60 'fen' (分).
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionUnit for one Chinese day (100 'ke').Unit for one Chinese 'fen' (60 Chinese seconds).Unit for one Chinese 'ke' (60 'fen').Unit for one Chinese millisecond.The base unit for Chinese seconds (approx. 0.24 standard seconds).static final intNumber of 'fen' per 'ke'.static final intNumber of 'ke' per day.static final intNumber of milliseconds per second.static final intNumber of seconds per 'fen' (custom implementation). -
Constructor Summary
ConstructorsConstructorDescriptionCreates ChineseTime with the current moment.ChineseTime(double millis) Creates ChineseTime from raw milliseconds.ChineseTime(double days, double ke, double fen, double seconds, double millis) Creates ChineseTime from components. -
Method Summary
-
Field Details
-
KE_PER_DAY
public static final int KE_PER_DAYNumber of 'ke' per day.- See Also:
-
FEN_PER_KE
public static final int FEN_PER_KENumber of 'fen' per 'ke'.- See Also:
-
SECONDS_PER_FEN
public static final int SECONDS_PER_FENNumber of seconds per 'fen' (custom implementation).- See Also:
-
MILLIS_PER_SECOND
public static final int MILLIS_PER_SECONDNumber of milliseconds per second.- See Also:
-
CHINESE_SECOND
-
CHINESE_MILLISECOND
-
CHINESE_FEN
-
CHINESE_KE
-
CHINESE_DAY
-
-
Constructor Details
-
ChineseTime
public ChineseTime(double days, double ke, double fen, double seconds, double millis) Creates ChineseTime from components.- Parameters:
days- dayske- count of 'ke' (0-99)fen- count of 'fen' (0-59)seconds- Chinese seconds (0-59)millis- Chinese milliseconds (0-999)- Throws:
IllegalArgumentException- if any value is negative
-
ChineseTime
public ChineseTime(double millis) Creates ChineseTime from raw milliseconds.- Parameters:
millis- total milliseconds- Throws:
IllegalArgumentException- if millis is negative
-
ChineseTime
public ChineseTime()Creates ChineseTime with the current moment.
-
-
Method Details
-
getTime
-
getMilliseconds
public int getMilliseconds()- Specified by:
getMillisecondsin classTime
-
getSeconds
public int getSeconds()- Specified by:
getSecondsin classTime
-
getMinutes
public int getMinutes()- Specified by:
getMinutesin classTime
-
getHours
-
getDays
-
nextMillisecond
public void nextMillisecond()- Specified by:
nextMillisecondin classTime
-
nextSecond
public void nextSecond()- Specified by:
nextSecondin classTime
-
nextMinute
public void nextMinute()- Specified by:
nextMinutein classTime
-
nextHour
-
nextDay
-
toString
-