/** * Compares the Label to other objects. * * <p> * Labels can be compared to other labels for sorting label contents. This * is especially handy for sorting table columns. * </p> * * <p> * In RAW, PREFORMATTED and TEXT modes, the label contents are compared as * is. In XML, UIDL and HTML modes, only CDATA is compared and tags ignored. * If the other object is not a Label, its toString() return value is used * in comparison. * </p> * * @param other * the Other object to compare to. * @return a negative integer, zero, or a positive integer as this object is * less than, equal to, or greater than the specified object. * @see java.lang.Comparable#compareTo(java.lang.Object) */ @Override public int compareTo(Label other) { String thisValue = getComparableValue(); String otherValue = other.getComparableValue(); return thisValue.compareTo(otherValue); }