Home
last modified time | relevance | path

Searched refs:Ordering (Results 1 – 25 of 407) sorted by relevance

12345678910>>...17

/external/guava/android/guava-tests/test/com/google/common/collect/
DComparatorsTest.java37 Comparator<String> comparator = Ordering.natural(); in testLexicographical()
51 .addEqualityGroup(Ordering.natural()) in testLexicographical()
56 assertFalse(Comparators.isInOrder(asList(5, 3, 0, 9), Ordering.natural())); in testIsInOrder()
57 assertFalse(Comparators.isInOrder(asList(0, 5, 3, 9), Ordering.natural())); in testIsInOrder()
58 assertTrue(Comparators.isInOrder(asList(0, 3, 5, 9), Ordering.natural())); in testIsInOrder()
59 assertTrue(Comparators.isInOrder(asList(0, 0, 3, 3), Ordering.natural())); in testIsInOrder()
60 assertTrue(Comparators.isInOrder(asList(0, 3), Ordering.natural())); in testIsInOrder()
61 assertTrue(Comparators.isInOrder(Collections.singleton(1), Ordering.natural())); in testIsInOrder()
62 assertTrue(Comparators.isInOrder(Collections.<Integer>emptyList(), Ordering.natural())); in testIsInOrder()
66 assertFalse(Comparators.isInStrictOrder(asList(5, 3, 0, 9), Ordering.natural())); in testIsInStrictOrder()
[all …]
DOrderingTest.java30 import com.google.common.collect.Ordering.ArbitraryOrdering;
31 import com.google.common.collect.Ordering.IncomparableValueException;
55 private final Ordering<Number> numberOrdering = new NumberOrdering();
58 Ordering<Object> comparator = Ordering.allEqual(); in testAllEqual()
75 Ordering<Iterable<Integer>> example = in testComplicatedOrderingExample()
76 Ordering.<Integer>natural().nullsFirst().reverse().lexicographical().reverse().nullsLast(); in testComplicatedOrderingExample()
105 Ordering<Integer> comparator = Ordering.natural(); in testNatural()
127 Ordering<String> caseInsensitiveOrdering = Ordering.from(String.CASE_INSENSITIVE_ORDER); in testFrom()
133 Ordering<String> orderingFromOrdering = Ordering.from(Ordering.<String>natural()); in testFrom()
135 .addEqualityGroup(caseInsensitiveOrdering, Ordering.from(String.CASE_INSENSITIVE_ORDER)) in testFrom()
[all …]
DTreeMultimapNaturalTest.java73 Ordering.natural().nullsFirst(), Ordering.natural().nullsFirst()); in suite()
83 return new Ordering<Entry<String, String>>() { in suite()
87 .compare(left.getKey(), right.getKey(), Ordering.natural().nullsFirst()) in suite()
89 left.getValue(), right.getValue(), Ordering.natural().nullsFirst()) in suite()
113 TreeMultimap.create(Ordering.natural().nullsFirst(), Ordering.natural()); in suite()
122 return Ordering.natural().nullsFirst().sortedCopy(insertionOrder); in suite()
170 return new Ordering<Entry<String, ?>>() { in suite()
229 TreeMultimap.create(Ordering.natural(), Ordering.natural().nullsFirst()); in suite()
236 return Ordering.natural().nullsFirst().sortedCopy(insertionOrder); in suite()
252 TreeMultimap.create(Ordering.natural(), Ordering.natural().nullsFirst()); in suite()
[all …]
DSortedIterablesTest.java29 assertTrue(SortedIterables.hasSameComparator(Ordering.natural(), Sets.newTreeSet())); in testSameComparator()
32 assertTrue(SortedIterables.hasSameComparator(Ordering.natural(), Maps.newTreeMap().keySet())); in testSameComparator()
36 Ordering.natural().reverse(), Sets.newTreeSet(Ordering.natural().reverse()))); in testSameComparator()
40 assertEquals(Ordering.natural(), SortedIterables.comparator(Sets.newTreeSet())); in testComparator()
DImmutableTableTest.java220 .orderRowsBy(Ordering.natural()) in testBuilder_orderRowsAndColumnsBy_putAll()
221 .orderColumnsBy(Ordering.natural()) in testBuilder_orderRowsAndColumnsBy_putAll()
232 builder.orderRowsBy(Ordering.natural()); in testBuilder_orderRowsAndColumnsBy_sparse()
233 builder.orderColumnsBy(Ordering.natural()); in testBuilder_orderRowsAndColumnsBy_sparse()
255 builder.orderRowsBy(Ordering.natural()); in testBuilder_orderRowsAndColumnsBy_dense()
256 builder.orderColumnsBy(Ordering.natural()); in testBuilder_orderRowsAndColumnsBy_dense()
277 builder.orderRowsBy(Ordering.natural()); in testBuilder_orderRowsBy_sparse()
294 builder.orderRowsBy(Ordering.natural()); in testBuilder_orderRowsBy_dense()
310 builder.orderColumnsBy(Ordering.natural()); in testBuilder_orderColumnsBy_sparse()
327 builder.orderColumnsBy(Ordering.natural()); in testBuilder_orderColumnsBy_dense()
[all …]
/external/guava/guava-tests/test/com/google/common/collect/
DOrderingTest.java30 import com.google.common.collect.Ordering.ArbitraryOrdering;
31 import com.google.common.collect.Ordering.IncomparableValueException;
55 private final Ordering<Number> numberOrdering = new NumberOrdering();
58 Ordering<Object> comparator = Ordering.allEqual(); in testAllEqual()
75 Ordering<Iterable<Integer>> example = in testComplicatedOrderingExample()
76 Ordering.<Integer>natural().nullsFirst().reverse().lexicographical().reverse().nullsLast(); in testComplicatedOrderingExample()
105 Ordering<Integer> comparator = Ordering.natural(); in testNatural()
127 Ordering<String> caseInsensitiveOrdering = Ordering.from(String.CASE_INSENSITIVE_ORDER); in testFrom()
133 Ordering<String> orderingFromOrdering = Ordering.from(Ordering.<String>natural()); in testFrom()
135 .addEqualityGroup(caseInsensitiveOrdering, Ordering.from(String.CASE_INSENSITIVE_ORDER)) in testFrom()
[all …]
DComparatorsTest.java42 Comparator<String> comparator = Ordering.natural(); in testLexicographical()
56 .addEqualityGroup(Ordering.natural()) in testLexicographical()
61 assertFalse(Comparators.isInOrder(asList(5, 3, 0, 9), Ordering.natural())); in testIsInOrder()
62 assertFalse(Comparators.isInOrder(asList(0, 5, 3, 9), Ordering.natural())); in testIsInOrder()
63 assertTrue(Comparators.isInOrder(asList(0, 3, 5, 9), Ordering.natural())); in testIsInOrder()
64 assertTrue(Comparators.isInOrder(asList(0, 0, 3, 3), Ordering.natural())); in testIsInOrder()
65 assertTrue(Comparators.isInOrder(asList(0, 3), Ordering.natural())); in testIsInOrder()
66 assertTrue(Comparators.isInOrder(Collections.singleton(1), Ordering.natural())); in testIsInOrder()
67 assertTrue(Comparators.isInOrder(Collections.<Integer>emptyList(), Ordering.natural())); in testIsInOrder()
71 assertFalse(Comparators.isInStrictOrder(asList(5, 3, 0, 9), Ordering.natural())); in testIsInStrictOrder()
[all …]
DTreeMultimapNaturalTest.java73 Ordering.natural().nullsFirst(), Ordering.natural().nullsFirst()); in suite()
83 return new Ordering<Entry<String, String>>() { in suite()
87 .compare(left.getKey(), right.getKey(), Ordering.natural().nullsFirst()) in suite()
89 left.getValue(), right.getValue(), Ordering.natural().nullsFirst()) in suite()
113 TreeMultimap.create(Ordering.natural().nullsFirst(), Ordering.natural()); in suite()
122 return Ordering.natural().nullsFirst().sortedCopy(insertionOrder); in suite()
170 return new Ordering<Entry<String, ?>>() { in suite()
229 TreeMultimap.create(Ordering.natural(), Ordering.natural().nullsFirst()); in suite()
236 return Ordering.natural().nullsFirst().sortedCopy(insertionOrder); in suite()
252 TreeMultimap.create(Ordering.natural(), Ordering.natural().nullsFirst()); in suite()
[all …]
DSortedIterablesTest.java29 assertTrue(SortedIterables.hasSameComparator(Ordering.natural(), Sets.newTreeSet())); in testSameComparator()
32 assertTrue(SortedIterables.hasSameComparator(Ordering.natural(), Maps.newTreeMap().keySet())); in testSameComparator()
36 Ordering.natural().reverse(), Sets.newTreeSet(Ordering.natural().reverse()))); in testSameComparator()
40 assertEquals(Ordering.natural(), SortedIterables.comparator(Sets.newTreeSet())); in testComparator()
/external/guava/guava/src/com/google/common/collect/
DNaturalOrdering.java28 final class NaturalOrdering extends Ordering<Comparable> implements Serializable {
31 private transient @MonotonicNonNull Ordering<Comparable> nullsFirst;
32 private transient @MonotonicNonNull Ordering<Comparable> nullsLast;
42 public <S extends Comparable> Ordering<S> nullsFirst() { in nullsFirst()
43 Ordering<Comparable> result = nullsFirst; in nullsFirst()
47 return (Ordering<S>) result; in nullsFirst()
51 public <S extends Comparable> Ordering<S> nullsLast() { in nullsLast()
52 Ordering<Comparable> result = nullsLast; in nullsLast()
56 return (Ordering<S>) result; in nullsLast()
60 public <S extends Comparable> Ordering<S> reverse() { in reverse()
[all …]
DOrdering.java144 public abstract class Ordering<T> implements Comparator<T> { class
158 public static <C extends Comparable> Ordering<C> natural() { in natural()
159 return (Ordering<C>) NaturalOrdering.INSTANCE; in natural()
178 public static <T> Ordering<T> from(Comparator<T> comparator) { in from()
179 return (comparator instanceof Ordering) in from()
180 ? (Ordering<T>) comparator in from()
191 public static <T> Ordering<T> from(Ordering<T> ordering) { in from()
216 public static <T> Ordering<T> explicit(List<T> valuesInOrder) { in explicit()
242 public static <T> Ordering<T> explicit(T leastValue, T... remainingValuesInOrder) { in explicit()
278 public static Ordering<Object> allEqual() { in allEqual()
[all …]
DNullsFirstOrdering.java25 final class NullsFirstOrdering<T> extends Ordering<T> implements Serializable {
26 final Ordering<? super T> ordering;
28 NullsFirstOrdering(Ordering<? super T> ordering) { in NullsFirstOrdering()
47 public <S extends T> Ordering<S> reverse() { in reverse()
54 public <S extends T> Ordering<S> nullsFirst() { in nullsFirst()
55 return (Ordering<S>) this; in nullsFirst()
59 public <S extends T> Ordering<S> nullsLast() { in nullsLast()
DNullsLastOrdering.java25 final class NullsLastOrdering<T> extends Ordering<T> implements Serializable {
26 final Ordering<? super T> ordering;
28 NullsLastOrdering(Ordering<? super T> ordering) { in NullsLastOrdering()
47 public <S extends T> Ordering<S> reverse() { in reverse()
53 public <S extends T> Ordering<S> nullsFirst() { in nullsFirst()
59 public <S extends T> Ordering<S> nullsLast() { in nullsLast()
60 return (Ordering<S>) this; in nullsLast()
DImmutableSortedMultiset.java120 return copyOf(Ordering.natural(), Arrays.asList(e1, e2)); in of()
131 return copyOf(Ordering.natural(), Arrays.asList(e1, e2, e3)); in of()
143 return copyOf(Ordering.natural(), Arrays.asList(e1, e2, e3, e4)); in of()
155 return copyOf(Ordering.natural(), Arrays.asList(e1, e2, e3, e4, e5)); in of()
171 return copyOf(Ordering.natural(), all); in of()
181 return copyOf(Ordering.natural(), Arrays.asList(elements)); in copyOf()
209 Ordering<E> naturalOrder = (Ordering<E>) Ordering.<Comparable>natural(); in copyOf()
227 Ordering<E> naturalOrder = (Ordering<E>) Ordering.<Comparable>natural(); in copyOf()
313 if (Ordering.natural().equals(comparator)) { in emptyMultiset()
338 ? emptyMultiset(Ordering.from(comparator()).reverse()) in descendingMultiset()
[all …]
DImmutableSortedSet.java83 if (Ordering.natural().equals(comparator)) { in emptySet()
97 return new RegularImmutableSortedSet<E>(ImmutableList.of(element), Ordering.natural()); in of()
109 return construct(Ordering.natural(), 2, e1, e2); in of()
121 return construct(Ordering.natural(), 3, e1, e2, e3); in of()
133 return construct(Ordering.natural(), 4, e1, e2, e3, e4); in of()
146 return construct(Ordering.natural(), 5, e1, e2, e3, e4, e5); in of()
168 return construct(Ordering.natural(), contents.length, (E[]) contents); in of()
182 return construct(Ordering.natural(), elements.length, elements.clone()); in copyOf()
210 Ordering<E> naturalOrder = (Ordering<E>) Ordering.<Comparable>natural(); in copyOf()
242 Ordering<E> naturalOrder = (Ordering<E>) Ordering.<Comparable>natural(); in copyOf()
[all …]
/external/guava/android/guava/src/com/google/common/collect/
DNaturalOrdering.java28 final class NaturalOrdering extends Ordering<Comparable> implements Serializable {
31 @MonotonicNonNullDecl private transient Ordering<Comparable> nullsFirst;
32 @MonotonicNonNullDecl private transient Ordering<Comparable> nullsLast;
42 public <S extends Comparable> Ordering<S> nullsFirst() { in nullsFirst()
43 Ordering<Comparable> result = nullsFirst; in nullsFirst()
47 return (Ordering<S>) result; in nullsFirst()
51 public <S extends Comparable> Ordering<S> nullsLast() { in nullsLast()
52 Ordering<Comparable> result = nullsLast; in nullsLast()
56 return (Ordering<S>) result; in nullsLast()
60 public <S extends Comparable> Ordering<S> reverse() { in reverse()
[all …]
DOrdering.java144 public abstract class Ordering<T> implements Comparator<T> { class
158 public static <C extends Comparable> Ordering<C> natural() { in natural()
159 return (Ordering<C>) NaturalOrdering.INSTANCE; in natural()
178 public static <T> Ordering<T> from(Comparator<T> comparator) { in from()
179 return (comparator instanceof Ordering) in from()
180 ? (Ordering<T>) comparator in from()
191 public static <T> Ordering<T> from(Ordering<T> ordering) { in from()
216 public static <T> Ordering<T> explicit(List<T> valuesInOrder) { in explicit()
242 public static <T> Ordering<T> explicit(T leastValue, T... remainingValuesInOrder) { in explicit()
278 public static Ordering<Object> allEqual() { in allEqual()
[all …]
DNullsFirstOrdering.java25 final class NullsFirstOrdering<T> extends Ordering<T> implements Serializable {
26 final Ordering<? super T> ordering;
28 NullsFirstOrdering(Ordering<? super T> ordering) { in NullsFirstOrdering()
47 public <S extends T> Ordering<S> reverse() { in reverse()
54 public <S extends T> Ordering<S> nullsFirst() { in nullsFirst()
55 return (Ordering<S>) this; in nullsFirst()
59 public <S extends T> Ordering<S> nullsLast() { in nullsLast()
DNullsLastOrdering.java25 final class NullsLastOrdering<T> extends Ordering<T> implements Serializable {
26 final Ordering<? super T> ordering;
28 NullsLastOrdering(Ordering<? super T> ordering) { in NullsLastOrdering()
47 public <S extends T> Ordering<S> reverse() { in reverse()
53 public <S extends T> Ordering<S> nullsFirst() { in nullsFirst()
59 public <S extends T> Ordering<S> nullsLast() { in nullsLast()
60 return (Ordering<S>) this; in nullsLast()
DImmutableSortedSet.java62 if (Ordering.natural().equals(comparator)) { in emptySet()
76 return new RegularImmutableSortedSet<E>(ImmutableList.of(element), Ordering.natural()); in of()
88 return construct(Ordering.natural(), 2, e1, e2); in of()
100 return construct(Ordering.natural(), 3, e1, e2, e3); in of()
112 return construct(Ordering.natural(), 4, e1, e2, e3, e4); in of()
125 return construct(Ordering.natural(), 5, e1, e2, e3, e4, e5); in of()
147 return construct(Ordering.natural(), contents.length, (E[]) contents); in of()
161 return construct(Ordering.natural(), elements.length, elements.clone()); in copyOf()
189 Ordering<E> naturalOrder = (Ordering<E>) Ordering.<Comparable>natural(); in copyOf()
221 Ordering<E> naturalOrder = (Ordering<E>) Ordering.<Comparable>natural(); in copyOf()
[all …]
DImmutableSortedMultiset.java76 return copyOf(Ordering.natural(), Arrays.asList(e1, e2)); in of()
87 return copyOf(Ordering.natural(), Arrays.asList(e1, e2, e3)); in of()
99 return copyOf(Ordering.natural(), Arrays.asList(e1, e2, e3, e4)); in of()
111 return copyOf(Ordering.natural(), Arrays.asList(e1, e2, e3, e4, e5)); in of()
127 return copyOf(Ordering.natural(), all); in of()
137 return copyOf(Ordering.natural(), Arrays.asList(elements)); in copyOf()
165 Ordering<E> naturalOrder = (Ordering<E>) Ordering.<Comparable>natural(); in copyOf()
183 Ordering<E> naturalOrder = (Ordering<E>) Ordering.<Comparable>natural(); in copyOf()
267 if (Ordering.natural().equals(comparator)) { in emptyMultiset()
292 ? emptyMultiset(Ordering.from(comparator()).reverse()) in descendingMultiset()
[all …]
/external/rust/crates/remain/src/
Dcompare.rs2 use std::cmp::Ordering;
10 fn partial_cmp(&self, other: &Path) -> Option<Ordering> { in partial_cmp() argument
16 fn cmp(&self, other: &Path) -> Ordering { in cmp() argument
20 Ordering::Equal => {} in cmp()
31 fn cmp(lhs: &str, rhs: &str) -> Ordering { in cmp() argument
34 (true, true) => return Ordering::Equal, in cmp()
35 (true, false) => return Ordering::Greater, in cmp()
36 (false, true) => return Ordering::Less, in cmp()
/external/cldr/tools/cldr-unittest/src/org/unicode/cldr/unittest/
DTestComparisonBuilder.java15 import org.unicode.cldr.util.DiscreteComparator.Ordering;
56 Builder<String> builder = new Builder<String>(Ordering.NATURAL); in dtdAttributes()
96 Builder<String> builder = new Builder<String>(Ordering.NATURAL); in TestDtdElements()
145 for (Ordering order : Ordering.values()) { in TestMonkey()
177 for (Ordering order : Ordering.values()) { in TestCycle3()
187 for (Ordering order : Ordering.values()) { in TestCycle7()
201 for (Ordering order : Ordering.values()) { in TestCycle2()
220 for (Ordering order : Ordering.values()) { in TestFallback()
242 for (Ordering order : Ordering.values()) { in TestFallback2()
/external/guava/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/
DImmutableSortedSet.java56 private static final Comparator NATURAL_ORDER = Ordering.natural();
83 return ofInternal(Ordering.natural(), element); in of()
88 return ofInternal(Ordering.natural(), e1, e2); in of()
93 return ofInternal(Ordering.natural(), e1, e2, e3); in of()
98 return ofInternal(Ordering.natural(), e1, e2, e3, e4); in of()
104 return ofInternal(Ordering.natural(), e1, e2, e3, e4, e5); in of()
115 return ofInternal(Ordering.natural(), (E[]) all.toArray(new Comparable[0])); in of()
135 return copyOfInternal((Ordering<E>) Ordering.natural(), (Collection) elements, false); in copyOf()
139 return copyOfInternal((Ordering<E>) Ordering.natural(), (Iterable) elements, false); in copyOf()
143 return copyOfInternal((Ordering<E>) Ordering.natural(), (Iterator) elements); in copyOf()
[all …]
/external/guava/guava-tests/test/com/google/common/graph/
DElementOrderTest.java24 import com.google.common.collect.Ordering;
70 assertThat(graph.nodeOrder()).isEqualTo(ElementOrder.sorted(Ordering.<Integer>natural())); in nodeOrder_natural()
78 .nodeOrder(ElementOrder.sorted(Ordering.<Integer>natural().reverse())) in nodeOrder_sorted()
84 .isEqualTo(ElementOrder.sorted(Ordering.<Integer>natural().reverse())); in nodeOrder_sorted()
130 assertThat(network.edgeOrder()).isEqualTo(ElementOrder.sorted(Ordering.<String>natural())); in edgeOrder_natural()
139 .edgeOrder(ElementOrder.sorted(Ordering.<String>natural().reverse())) in edgeOrder_sorted()
145 .isEqualTo(ElementOrder.sorted(Ordering.<String>natural().reverse())); in edgeOrder_sorted()
157 .edgeOrder(ElementOrder.sorted(Ordering.<String>natural().reverse())) in nodeOrderUnorderedandEdgesSorted()
163 .isEqualTo(ElementOrder.sorted(Ordering.<String>natural().reverse())); in nodeOrderUnorderedandEdgesSorted()
213 assertThat(graph.nodeOrder().comparator()).isEqualTo(Ordering.natural()); in customComparable()

12345678910>>...17