MCPcopy Create free account
hub / github.com/WinVector/Logistic / StrACmp

Class StrACmp

src/com/winvector/util/CountMap.java:72–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70 public static final Comparator<String> strCmp = new StrCmp();
71
72 private static class StrACmp implements Comparator<String[]>, Serializable {
73 private static final long serialVersionUID = 1L;
74
75 @Override
76 public int compare(final String[] arg0, final String[] arg1) {
77 final int n = arg0.length;
78 if(n!=arg1.length) {
79 if(n>arg1.length) {
80 return 1;
81 } else {
82 return -1;
83 }
84 }
85 for(int i=0;i<n;++i) {
86 final int cmpi = arg0[i].compareTo(arg1[i]);
87 if(cmpi!=0) {
88 return cmpi;
89 }
90 }
91 return 0;
92 }
93 }
94
95 public static final Comparator<String[]> strACmp = new StrACmp();
96}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected