Best code examples for Java 8 Comparator class (java.util.Comparator)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 Comparator class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Java 8 Comparator examples from Open Source projects
This code example shows how to use the following methods: compare
56:	return JSON_ARRAY_COMPARATOR.compare((JSONArray) o1, (JSONArray) o2) == 0; 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: compare
27:	Preconditions.checkNotNull(comparator); 
-
74:	int c = comp.compare(nextFirst, nextSecond); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: compare
98:	Assert.assertEquals(-1, comp.compare(before, after)); 
99:	Assert.assertEquals(0, comp.compare(before, before)); 
100:	Assert.assertEquals(0, comp.compare(after, after)); 
101:	Assert.assertEquals(1, comp.compare(after, before)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compare
84:	return comparator.compare(chunkNumber, linearChunk.chunkNumber); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: compare
98:	return comparator.compare(chunkNumber, stringChunk.chunkNumber); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: compare
41:	return CASE_INSENSITIVE_ORDER.compare(lPath, rPath); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compare
99:	return comparator.compare(chunkNumber, intChunk.chunkNumber); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: equals
228:	if (cc == mc || (cc != null && cc.equals(mc))) { 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compare
56:	return CASE_INSENSITIVE_ORDER.compare(lhsLogin, rhsLogin); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: equals
113:	return (this.nonNullComparator.equals(other.nonNullComparator) && this.nullsLow == other.nullsLow); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: equals
115:	return (this.comparator.equals(other.comparator) && this.ascending == other.ascending); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compare
104:	c = m_cmp.compare(t1.get(m_field), t2.get(m_field)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compare
35:	return entityComparator.compare(o1.getEntityContainer(), o2.getEntityContainer()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compare
81:	int advisorPrecedence = this.advisorComparator.compare(o1, o2); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compare
43:	return Integer.valueOf(_comparator.compare(target, argument)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compare
37:	return entityComparator.compare(o1.getEntity(), o2.getEntity()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compare
74:	if (comp.compare(left, mid) > 0) { 
75:	if (comp.compare(mid, right) > 0) { 
-
77:	} else if (comp.compare(left, right) > 0) { 
-
83:	if (comp.compare(left, right) > 0) { 
-
85:	} else if (comp.compare(mid, right) > 0) { 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: compare
64:	int val = comparator.compare(wa, wb); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: compare
156:	int result = STATIC_VERSION_COMPARATOR.compare(version1, version2); 
-
164:	int result = STATIC_VERSION_COMPARATOR.compare(version1, version2); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: compare
28:	return STATIC_VERSION_COMPARATOR.compare(version1, version2); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compare
272:	int position; 
-
278:	} 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: compare
52:	return this.comparator.compare(c1, c2); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compare
46:	return _comparator.compare( 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: compare
41:	return c.compare(a, b); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compare
245:	return comparator == null ? x.equals(y) : comparator.compare(x, y) == 0; 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compare
45:	return this.comparator.compare(attrValue1, attrValue2); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compare
41:	if (comparator.compare(selectedParticle, offspring) < 0) { 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compare, equals
112:	comparator.compare(lowerEndpoint, lowerEndpoint); 
-
115:	comparator.compare(upperEndpoint, upperEndpoint); 
-
118:	int cmp = comparator.compare(lowerEndpoint, upperEndpoint); 
-
172:	checkArgument(comparator.equals(other.comparator)); 
-
183:	int cmp = comparator.compare(getLowerEndpoint(), other.getLowerEndpoint()); 
-
199:	int cmp = comparator.compare(getUpperEndpoint(), other.getUpperEndpoint()); 
-
207:	int cmp = comparator.compare(lowEnd, upEnd); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: compare
39:	return comparator.compare(arr[i], arr[j]); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compare
41:	return comparator.compare(arr[i], arr[j]); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compare
48:	return comparator.compare(arr[i], arr[j]); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compare
39:	return fComparator.compare(o1, o2); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: compare
9:	return comparator.compare(value1, value2) > 0 ? value1 : value2; 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: compare
63:	return cmp_.compare(a, b); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: compare
85:	return _comparator.compare(e1, e2); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: compare
64:	return comp.compare(list.get(i), list.get(j)); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: compare
50:	return comparator.compare(list.get(index), e); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: compare
25:	return String.CASE_INSENSITIVE_ORDER.compare(o1.getName(), o2.getName()); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: compare
55:	return getSuperComparator().compare(o1, o2); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: compare
30:	return CASE_INSENSITIVE_ORDER.compare(p1.name(), p2.name()); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: compare
118:	return CHARSEQUENCE_COMPARATOR.compare(key, o.key); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: compare
172:	return utf8SortedAsUnicodeSortOrder.compare(this, other); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: compare
188:	return this.comparator.compare(o2, o1); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: compare
66:	return comparator.compare( lhs, rhs ); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: compare
56:	return objectComparator.compare( lhs, rhs ); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: compare
126:	c = m_cmp.compare(t1.get(m_col), t2.get(m_col)); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: compare
43:	return Integer.valueOf(_comparator.compare(target, argument)); 
Full Snippet Info
5
CodeRank
Related Java 8 Comparator Questions & Answers:
See Code Examples for Java 8 Comparator Methods: