public static final class ArraysMDE.StringArrayComparatorLexical
extends java.lang.Object
implements java.util.Comparator<java.lang.String[]>, java.io.Serializable
Note: this comparator imposes orderings that are inconsistent with Object.equals(java.lang.Object)
.
That is, it may return 0 if the arrays contain identical numbers but are not equal according to
equals()
.
Constructor and Description |
---|
StringArrayComparatorLexical() |
Modifier and Type | Method and Description |
---|---|
int |
compare(java.lang.String[] a1,
java.lang.String[] a2)
Compare two arrays lexically (element-by-element).
|
public int compare(java.lang.String[] a1, java.lang.String[] a2)
compare
in interface java.util.Comparator<java.lang.String[]>
a1
- first array to comparea2
- second array to compare