MCPcopy Create free account
hub / github.com/MenoData/Time4J / SimpleUT

Class SimpleUT

base/src/main/java/net/time4j/tz/SimpleUT.java:32–75  ·  view source on GitHub ↗

Simple implementation of UnixTime. @author Meno Hochschild @since 5.0

Source from the content-addressed store, hash-verified

30 * @since 5.0
31 */
32class SimpleUT
33 implements UnixTime {
34
35 //~ Instanzvariablen --------------------------------------------------
36
37 private final long posix;
38 private final int nano;
39
40 //~ Konstruktoren -----------------------------------------------------
41
42 private SimpleUT(long posix, int nano) {
43 super();
44
45 this.posix = posix;
46 this.nano = nano;
47 }
48
49 //~ Methoden ----------------------------------------------------------
50
51 @Override
52 public long getPosixTime() {
53 return this.posix;
54 }
55
56 @Override
57 public int getNanosecond() {
58 return this.nano;
59 }
60
61 static UnixTime previousTime(UnixTime ut) {
62 return previousTime(ut.getPosixTime(), ut.getNanosecond());
63 }
64
65 static UnixTime previousTime(
66 long posix,
67 int nano
68 ) {
69 return new SimpleUT(
70 (nano == 0) ? (posix - 1) : posix,
71 (nano == 0) ? 999_999_999 : (nano - 1)
72 );
73 }
74
75}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected