/** * 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; } }
/** * Returns <code>true</code> if this object is equal to the specified * object, and <code>false</code> otherwise. * * @param obj the other object. * * @return A boolean. */ public boolean equals(final Object obj) { if (this == obj) { return true; } if (!(obj instanceof SortOrder)) { return false; } final SortOrder that = (SortOrder) obj; if (!this.name.equals(that.toString())) { return false; } return true; }
/** * Returns <code>true</code> if this object is equal to the specified * object, and <code>false</code> otherwise. * * @param obj the other object. * * @return A boolean. */ public boolean equals(final Object obj) { if (this == obj) { return true; } if (!(obj instanceof SortOrder)) { return false; } final SortOrder that = (SortOrder) obj; if (!this.name.equals(that.toString())) { return false; } return true; }
/** * 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; } }
/** * Returns <code>true</code> if this object is equal to the specified * object, and <code>false</code> otherwise. * * @param obj the other object. * * @return A boolean. */ public boolean equals(final Object obj) { if (this == obj) { return true; } if (!(obj instanceof SortOrder)) { return false; } final SortOrder that = (SortOrder) obj; if (!this.name.equals(that.toString())) { return false; } return true; }
/** * 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;