/** * Invert the sort order of each sort definition contained by this compound * comparator. */ public void invertOrder() { for (InvertibleComparator comparator : this.comparators) { comparator.invertOrder(); } }
/** * Invert the sort order of the sort definition at the specified index. * @param index the index of the comparator to invert */ public void invertOrder(int index) { this.comparators.get(index).invertOrder(); }
/** * Invert the sort order of each sort definition contained by this compound * comparator. */ public void invertOrder() { for (InvertibleComparator comparator : this.comparators) { comparator.invertOrder(); } }
/** * Invert the sort order of the sort definition at the specified index. * @param index the index of the comparator to invert */ public void invertOrder(int index) { this.comparators.get(index).invertOrder(); }
@Test public void shouldInvert() throws Exception { InvertibleComparator<Integer> invertibleComparator = new InvertibleComparator<>(comparator); assertThat(invertibleComparator.isAscending(), is(true)); assertThat(invertibleComparator.compare(1, 2), is(-1)); invertibleComparator.invertOrder(); assertThat(invertibleComparator.isAscending(), is(false)); assertThat(invertibleComparator.compare(1, 2), is(1)); }
/** * Invert the sort order of each sort definition contained by this compound * comparator. */ public void invertOrder() { for (InvertibleComparator comparator : this.comparators) { comparator.invertOrder(); } }
/** * Invert the sort order of the sort definition at the specified index. * @param index the index of the comparator to invert */ public void invertOrder(int index) { this.comparators.get(index).invertOrder(); }
/** * Invert the sort order of each sort definition contained by this compound * comparator. */ public void invertOrder() { for (InvertibleComparator comparator : this.comparators) { comparator.invertOrder(); } }
/** * Invert the sort order of each sort definition contained by this compound * comparator. */ public void invertOrder() { for (InvertibleComparator comparator : this.comparators) { comparator.invertOrder(); } }
/** * Invert the sort order of the sort definition at the specified index. * @param index the index of the comparator to invert */ public void invertOrder(int index) { this.comparators.get(index).invertOrder(); }
/** * Invert the sort order of the sort definition at the specified index. * @param index the index of the comparator to invert */ public void invertOrder(int index) { this.comparators.get(index).invertOrder(); }
/** * Invert the sort order of each sort definition contained by this compound * comparator. */ public void invertOrder() { Iterator it = this.comparators.iterator(); while (it.hasNext()) { ((InvertibleComparator) it.next()).invertOrder(); } }
/** * Invert the sort order of the sort definition at the specified index. * @param index the index of the comparator to invert */ public void invertOrder(int index) { getInvertibleComparator(index).invertOrder(); }