@Override public boolean equals(Object obj) { if (this == obj) { return true; } else if (obj instanceof PlainTimestamp) { PlainTimestamp that = (PlainTimestamp) obj; return (this.date.equals(that.date) && this.time.equals(that.time)); } else { return false; } }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } else if (obj instanceof GeneralTimestamp) { GeneralTimestamp<?> that = GeneralTimestamp.class.cast(obj); if (!this.time.equals(that.time)) { return false; } else if (this.cv == null) { return ((that.cv == null) && this.ca.equals(that.ca)); } else { return ((that.ca == null) && this.cv.equals(that.cv)); } } return false; }
if (context.equals(PlainTime.MIN)) { return BigDecimal.ZERO; } else if (context.hour == 24) {
protected boolean isEqual(GregorianTimezoneRule rule) { return ( this.getTimeOfDay().equals(rule.getTimeOfDay()) && (this.getIndicator() == rule.getIndicator()) && (this.getSavings0() == rule.getSavings0()) && (this.month == rule.month)); }
@Override public boolean isValid( PlainTimestamp context, V value ) { if (value == null) { return false; } if (this.element.isDateElement()) { return context.date.isValid(this.element, value); } else if (this.element.isTimeElement()) { if (Number.class.isAssignableFrom(this.element.getType())) { long min = this.toNumber(this.element.getDefaultMinimum()); long max = this.toNumber(this.element.getDefaultMaximum()); long val = this.toNumber(value); return ((min <= val) && (max >= val)); } else if ( this.element.equals(WALL_TIME) && PlainTime.MAX.equals(value) ) { return false; } else { return context.time.isValid(this.element, value); } } throw new ChronoException( "Missing rule for: " + this.element.name()); }
/** * <p>Yields the length of this interval. </p> * * @return duration in hours, minutes, seconds and nanoseconds * @since 2.0 */ /*[deutsch] * <p>Liefert die Länge dieses Intervalls. </p> * * @return duration in hours, minutes, seconds and nanoseconds * @since 2.0 */ public Duration<ClockUnit> getDuration() { PlainTime t1 = this.getTemporalOfClosedStart(); PlainTime t2 = this.getEnd().getTemporal(); if (this.getEnd().isClosed()) { if (t2.getHour() == 24) { if (t1.equals(PlainTime.midnightAtStartOfDay())) { return Duration.of(24, HOURS).plus(1, NANOS); } else { t1 = t1.minus(1, NANOS); } } else { t2 = t2.plus(1, NANOS); } } return Duration.inClockUnits().between(t1, t2); }