/** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * * @param o * the Object to be compared. * @return a negative integer, zero, or a positive integer as this object is * less than, equal to, or greater than the specified object. * @throws ClassCastException * if the specified object's type prevents it from being * compared to this Object. */ public int compareTo(DvOrdered o) { DvTemporal d = (DvTemporal) o; return getDateTime().compareTo(d.getDateTime()); }
/** * Create a Duration from two instances of DvWorldTime * * @param start * @param end */ public static DvDuration getDifference(DvTemporal start, DvTemporal end) { Duration d = new Duration(start.getDateTime(), end.getDateTime()); return new DvDuration(null, null, null, 0.0, false, null, d.toPeriodFrom(start.getDateTime())); }
/** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * * @param o * the Object to be compared. * @return a negative integer, zero, or a positive integer as this object is * less than, equal to, or greater than the specified object. * @throws ClassCastException * if the specified object's type prevents it from being * compared to this Object. */ public int compareTo(DvOrdered o) { DvTemporal d = (DvTemporal) o; return getDateTime().compareTo(d.getDateTime()); }
/** * Create a Duration from two instances of DvWorldTime * * @param start * @param end */ public static DvDuration getDifference(DvTemporal start, DvTemporal end) { Duration d = new Duration(start.getDateTime(), end.getDateTime()); return new DvDuration(null, null, null, 0.0, false, null, d.toPeriodFrom(start.getDateTime())); }
static DateTime getDateTime(DvTemporal operationDataValue, String value) { if (operationDataValue instanceof DvDateTime) { return operationDataValue.getDateTime(); } else if (operationDataValue instanceof DvDate) { return operationDataValue.getDateTime(); } else if (operationDataValue instanceof DvTime) { return operationDataValue.getDateTime(); } else { if (operationDataValue == null) { throw new IllegalArgumentException( format("Cannot use null data value to evaluate expression %s", value)); } else { throw new IllegalArgumentException( format("Cannot use data value with class %s to evaluate expression %s", operationDataValue.getClass().getName(), value)); } } }
DvTemporal dvTemporal1 = (DvTemporal) dv1; DvTemporal dvTemporal2 = (DvTemporal) dv2; return dvTemporal1.getDateTime().getMillis() == dvTemporal2.getDateTime().getMillis(); } else { return dv1 == null && dv2 == null