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

Method getRule

base/src/main/java/net/time4j/engine/TimeAxis.java:555–574  ·  view source on GitHub ↗

Liefert die chronologische Regel zur angegebenen Zeiteinheit. @param unit time unit @return unit rule or null if not registered

(U unit)

Source from the content-addressed store, hash-verified

553 * @return unit rule or {@code null} if not registered
554 */
555 UnitRule<T> getRule(U unit) {
556
557 if (unit == null) {
558 throw new NullPointerException("Missing chronological unit.");
559 }
560
561 UnitRule<T> rule = this.unitRules.get(unit);
562
563 if (rule == null) {
564 if (unit instanceof BasicUnit) {
565 rule = BasicUnit.class.cast(unit).derive(this);
566 }
567 if (rule == null) {
568 throw new RuleNotFoundException(this, unit);
569 }
570 }
571
572 return rule;
573
574 }
575
576 private static <U> double getLength(
577 Map<U, Double> unitLengths,

Callers 7

floorMethod · 0.45
ceilingMethod · 0.45
valueMethod · 0.45
withFloorMethod · 0.45
withCeilingMethod · 0.45
plusMethod · 0.45
untilMethod · 0.45

Calls 3

getMethod · 0.65
deriveMethod · 0.45
castMethod · 0.45

Tested by

no test coverage detected