compareTo method
- Vector<
T> other
Lexicographically compares this vector to other.
Implementation
int compareTo(Vector<T> other) {
int len = _data.length < other._data.length
? _data.length
: other._data.length;
for (int i = 0; i < len; i++) {
int comparison = _data[i].compareTo(other._data[i]);
if (comparison != 0) {
return comparison;
}
}
return _data.length.compareTo(other._data.length);
}