Das Element für die Genauigkeit einer Uhrzeitangabe. @author Meno Hochschild
| 34 | * @author Meno Hochschild |
| 35 | */ |
| 36 | class PrecisionElement<U extends Comparable<U>> |
| 37 | implements ChronoElement<U> { |
| 38 | |
| 39 | //~ Statische Felder/Initialisierungen -------------------------------- |
| 40 | |
| 41 | static final ChronoElement<ClockUnit> CLOCK_PRECISION = |
| 42 | new PrecisionElement<>(ClockUnit.class, ClockUnit.HOURS, ClockUnit.NANOS); |
| 43 | static final ChronoElement<TimeUnit> TIME_PRECISION = |
| 44 | new PrecisionElement<>(TimeUnit.class, TimeUnit.DAYS, TimeUnit.NANOSECONDS); |
| 45 | |
| 46 | //~ Instanzvariablen -------------------------------------------------- |
| 47 | |
| 48 | private final Class<U> type; |
| 49 | private transient final U min; |
| 50 | private transient final U max; |
| 51 | |
| 52 | //~ Konstruktoren ----------------------------------------------------- |
| 53 | |
| 54 | private PrecisionElement( |
| 55 | Class<U> type, |
| 56 | U min, |
| 57 | U max |
| 58 | ) { |
| 59 | super(); |
| 60 | |
| 61 | this.type = type; |
| 62 | this.min = min; |
| 63 | this.max = max; |
| 64 | |
| 65 | } |
| 66 | |
| 67 | //~ Methoden ---------------------------------------------------------- |
| 68 | |
| 69 | @Override |
| 70 | public String name() { |
| 71 | |
| 72 | return "PRECISION"; |
| 73 | |
| 74 | } |
| 75 | |
| 76 | @Override |
| 77 | public Class<U> getType() { |
| 78 | |
| 79 | return this.type; |
| 80 | |
| 81 | } |
| 82 | |
| 83 | @Override |
| 84 | public U getDefaultMinimum() { |
| 85 | |
| 86 | return this.min; |
| 87 | |
| 88 | } |
| 89 | |
| 90 | @Override |
| 91 | public U getDefaultMaximum() { |
| 92 | |
| 93 | return this.max; |
nothing calls this directly
no outgoing calls
no test coverage detected