if (p0 != p1) {
return p0 < p1 -1 : 1;
}
final int e0 = getElementIndex();
final int e1 = position.getElementIndex();
if (e0 != e1) {
return e0 < e1 -1 : 1;
}
final int c0 = getCharIndex();
final int c1 = position.getCharIndex();
if (c0 != c1) {
return c0 < c1 -1 : 1;
}
return 0;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
}
if (!(obj instanceof ZLTextPosition)) {
return false;
}
final ZLTextPosition position = (ZLTextPosition)obj;
return samePositionAs(position);
}
@Override
public int hashCode() {
return (getParagraphIndex() << 16) + (getElementIndex() << 8) + getCharIndex();
}
@Override
public String toString() {
return getClass().getName() + " " + getParagraphIndex() + " " + getElementIndex() + " " + getCharIndex();
}
}
摘自 ASCE1885