public int compareTo(DurationField durationField) { return iField.compareTo(durationField); }
public int compareTo(DurationField durationField) { return iField.compareTo(durationField); }
static int compareReverse(DurationField a, DurationField b) { if (a == null || !a.isSupported()) { if (b == null || !b.isSupported()) { return 0; } return -1; } if (b == null || !b.isSupported()) { return 1; } return -a.compareTo(b); } }
static int compareReverse(DurationField a, DurationField b) { if (a == null || !a.isSupported()) { if (b == null || !b.isSupported()) { return 0; } return -1; } if (b == null || !b.isSupported()) { return 1; } return -a.compareTo(b); } }
public static boolean isMoreSpecific(DateTimeFieldType df1, DateTimeFieldType df2, Chronology chronology) { DurationFieldType df1DurationFieldType = df1.getDurationType(); DurationFieldType df2DurationFieldType = df2.getDurationType(); if (!df2DurationFieldType.equals(df1DurationFieldType)) { DurationField df2Unit = df2DurationFieldType.getField(chronology); DurationFieldType p = df1.getRangeDurationType(); if (p != null) { DurationField df1Unit = df1DurationFieldType.getField(chronology); int cmp = df1Unit.compareTo(df2Unit); if (cmp < 0) { return true; } } } return false; }
public static boolean isMoreGeneral(DateTimeFieldType df1, DateTimeFieldType df2, Chronology chronology) { DurationFieldType df1DurationFieldType = df1.getDurationType(); DurationFieldType df2DurationFieldType = df2.getDurationType(); if (!df2DurationFieldType.equals(df1DurationFieldType)) { DurationField df1Unit = df1DurationFieldType.getField(chronology); DurationFieldType p = df2.getRangeDurationType(); if (p != null) { DurationField df2Unit = df2DurationFieldType.getField(chronology); int cmp = df1Unit.compareTo(df2Unit); if (cmp > 0) { return true; } } } return false; }
public static Period discardMoreSpecificFields(Period p, DurationFieldType dft, Chronology chronology) { DurationField df = dft.getField(chronology); Period res = new Period(); for (int i = 0; i < p.size(); i++) { DurationFieldType fieldType = p.getFieldType(i); DurationField f = fieldType.getField(chronology); int cmp = df.compareTo(f); if (cmp <= 0) { res = res.withField(fieldType, p.getValue(i)); } } return res; }
int compare = lastUnitField.compareTo(loopUnitField); if (compare < 0) { throw new IllegalArgumentException("Types array must be in order largest-smallest: " + if (lastRangeField.compareTo(loopRangeField) < 0) { throw new IllegalArgumentException("Types array must be in order largest-smallest: " + types[i - 1].getName() + " < " + loopType.getName()); if (lastRangeField.compareTo(loopRangeField) == 0) { throw new IllegalArgumentException("Types array must not contain duplicate: " + types[i - 1].getName() + " and " + loopType.getName());
int compare = lastUnitField.compareTo(loopUnitField); if (compare < 0) { throw new IllegalArgumentException("Types array must be in order largest-smallest: " + if (lastRangeField.compareTo(loopRangeField) < 0) { throw new IllegalArgumentException("Types array must be in order largest-smallest: " + types[i - 1].getName() + " < " + loopType.getName()); if (lastRangeField.compareTo(loopRangeField) == 0) { throw new IllegalArgumentException("Types array must not contain duplicate: " + types[i - 1].getName() + " and " + loopType.getName());
public static Partial discardMoreSpecificFields(Partial p, DurationFieldType dft) { DurationField df = dft.getField(p.getChronology()); Partial res = new Partial(); for (int i = 0; i < p.size(); i++) { DateTimeFieldType fieldType = p.getFieldType(i); DurationField f = fieldType.getDurationType().getField(p.getChronology()); int cmp = df.compareTo(f); if (cmp <= 0) { res = res.with(fieldType, p.getValue(i)); } } return res; }
public int compareTo(DurationField durationField) { return iField.compareTo(durationField); }
static int compareReverse(DurationField a, DurationField b) { if (a == null || !a.isSupported()) { if (b == null || !b.isSupported()) { return 0; } return -1; } if (b == null || !b.isSupported()) { return 1; } return -a.compareTo(b); } }
DurationField loopUnitField = loopType.getDurationType().getField(iChronology); if (i > 0) { int compare = lastUnitField.compareTo(loopUnitField); if (compare < 0 || (compare != 0 && loopUnitField.isSupported() == false)) { throw new IllegalArgumentException("Types array must be in order largest-smallest: " + if (lastRangeField.compareTo(loopRangeField) < 0) { throw new IllegalArgumentException("Types array must be in order largest-smallest: " + types[i - 1].getName() + " < " + loopType.getName()); if (lastRangeField.compareTo(loopRangeField) == 0) { throw new IllegalArgumentException("Types array must not contain duplicate: " + loopType.getName());
DurationField loopUnitField = loopType.getDurationType().getField(iChronology); if (loopUnitField.isSupported()) { int compare = unitField.compareTo(loopUnitField); if (compare > 0) { break; DurationField rangeField = fieldType.getRangeDurationType().getField(iChronology); DurationField loopRangeField = loopType.getRangeDurationType().getField(iChronology); if (rangeField.compareTo(loopRangeField) > 0) { break;
static int compareReverse(DurationField a, DurationField b) { if (a == null || !a.isSupported()) { if (b == null || !b.isSupported()) { return 0; } return -1; } if (b == null || !b.isSupported()) { return 1; } return -a.compareTo(b); } }
private int compareReverse(DurationField a, DurationField b) { if (a == null || !a.isSupported()) { if (b == null || !b.isSupported()) { return 0; } return -1; } if (b == null || !b.isSupported()) { return 1; } return -a.compareTo(b); } }
static int compareReverse(DurationField a, DurationField b) { if (a == null || !a.isSupported()) { if (b == null || !b.isSupported()) { return 0; } return -1; } if (b == null || !b.isSupported()) { return 1; } return -a.compareTo(b); } }
static int compareReverse(DurationField a, DurationField b) { if (a == null || !a.isSupported()) { if (b == null || !b.isSupported()) { return 0; } return -1; } if (b == null || !b.isSupported()) { return 1; } return -a.compareTo(b); } }