| 4383 | //~ Methoden ------------------------------------------------------ |
| 4384 | |
| 4385 | @Override |
| 4386 | public <T extends TimePoint<? super IsoUnit, T>> Duration<IsoUnit> between( |
| 4387 | T start, |
| 4388 | T end |
| 4389 | ) { |
| 4390 | |
| 4391 | T t1 = start; |
| 4392 | T t2 = end; |
| 4393 | boolean negative = false; |
| 4394 | |
| 4395 | if (start.compareTo(end) > 0) { |
| 4396 | t1 = end; |
| 4397 | t2 = start; |
| 4398 | negative = true; |
| 4399 | } |
| 4400 | |
| 4401 | int o1 = this.getOffset(t1); |
| 4402 | int o2 = this.getOffset(t2); |
| 4403 | t2 = t2.plus(o1 - o2, SECONDS); |
| 4404 | Duration<IsoUnit> duration = this.metric.between(t1, t2); |
| 4405 | |
| 4406 | if (negative) { |
| 4407 | duration = duration.inverse(); |
| 4408 | } |
| 4409 | |
| 4410 | return duration; |
| 4411 | |
| 4412 | } |
| 4413 | |
| 4414 | private int getOffset(ChronoEntity<?> entity) { |
| 4415 | |