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

Method apply

base/src/main/java/net/time4j/engine/StdOperator.java:89–114  ·  view source on GitHub ↗
(T entity)

Source from the content-addressed store, hash-verified

87 //~ Methoden ------------------------------------------------------
88
89 @Override
90 public T apply(T entity) {
91
92 switch (this.mode) {
93 case NEW_VALUE_MODE:
94 return value(entity, this.element, this.value, false);
95 case MIN_MODE:
96 return min(entity, this.element);
97 case MAX_MODE:
98 return max(entity, this.element);
99 case FLOOR_MODE:
100 return floor(entity, this.element);
101 case CEILING_MODE:
102 return ceiling(entity, this.element);
103 case LENIENT_MODE:
104 return value(entity, this.element, this.value, true);
105 case DECREMENTING_MODE:
106 return this.move(entity, false);
107 case INCREMENTING_MODE:
108 return this.move(entity, true);
109 default:
110 throw new UnsupportedOperationException(
111 "Unknown mode: " + this.mode);
112 }
113
114 }
115
116 /**
117 * <p>Yields a new operator which can set any entity to its minimum

Callers

nothing calls this directly

Calls 6

valueMethod · 0.95
minMethod · 0.95
maxMethod · 0.95
floorMethod · 0.95
ceilingMethod · 0.95
moveMethod · 0.95

Tested by

no test coverage detected