@Override public int compareTo(StringTuple otherTuple) { int thisLength = length(); int otherLength = otherTuple.length(); int min = Math.min(thisLength, otherLength); for (int i = 0; i < min; i++) { int ret = this.tuple.get(i).compareTo(otherTuple.stringAt(i)); if (ret != 0) { return ret; } } if (thisLength < otherLength) { return -1; } else if (thisLength > otherLength) { return 1; } else { return 0; } }
@Override public int compareTo(StringTuple otherTuple) { int thisLength = length(); int otherLength = otherTuple.length(); int min = Math.min(thisLength, otherLength); for (int i = 0; i < min; i++) { int ret = this.tuple.get(i).compareTo(otherTuple.stringAt(i)); if (ret != 0) { return ret; } } if (thisLength < otherLength) { return -1; } else if (thisLength > otherLength) { return 1; } else { return 0; } }
@Override public int compareTo(StringTuple otherTuple) { int thisLength = length(); int otherLength = otherTuple.length(); int min = Math.min(thisLength, otherLength); for (int i = 0; i < min; i++) { int ret = this.tuple.get(i).compareTo(otherTuple.stringAt(i)); if (ret != 0) { return ret; } } if (thisLength < otherLength) { return -1; } else if (thisLength > otherLength) { return 1; } else { return 0; } }