/** * Ensures that serialization returns the unique instances. * * @return The object. * * @throws ObjectStreamException if there is a problem. */ private Object readResolve() throws ObjectStreamException { if (this.equals(SortOrder.ASCENDING)) { return SortOrder.ASCENDING; } else if (this.equals(SortOrder.DESCENDING)) { return SortOrder.DESCENDING; } return null; } }
/** * Ensures that serialization returns the unique instances. * * @return The object. * * @throws ObjectStreamException if there is a problem. */ private Object readResolve() throws ObjectStreamException { if (this.equals(SortOrder.ASCENDING)) { return SortOrder.ASCENDING; } else if (this.equals(SortOrder.DESCENDING)) { return SortOrder.DESCENDING; } return null; } }
/** * Ensures that serialization returns the unique instances. * * @return The object. * * @throws ObjectStreamException if there is a problem. */ private Object readResolve() throws ObjectStreamException { if (this.equals(SortOrder.ASCENDING)) { return SortOrder.ASCENDING; } else if (this.equals(SortOrder.DESCENDING)) { return SortOrder.DESCENDING; } return null; } }
if (this.order.equals(SortOrder.ASCENDING)) { result = kv1.getKey().compareTo(kv2.getKey()); else if (this.order.equals(SortOrder.DESCENDING)) { result = kv2.getKey().compareTo(kv1.getKey()); if (this.order.equals(SortOrder.ASCENDING)) { if (d1 > d2) { result = 1; else if (this.order.equals(SortOrder.DESCENDING)) { if (d1 > d2) { result = -1;