/** Determine the ordering of identity objects. * @param o Other identity * @return The relative ordering between the objects * @since 2.2 */ public int compareTo(Object o) { if (o instanceof IntIdentity) { IntIdentity other = (IntIdentity)o; int result = super.compare(other); if (result == 0) { return (key - other.key); } else { return result; } } else if (o == null) { throw new ClassCastException("object is null"); } throw new ClassCastException(this.getClass().getName() + " != " + o.getClass().getName()); }
/** Determine the ordering of identity objects. * @param o Other identity * @return The relative ordering between the objects * @since 2.2 */ public int compareTo(Object o) { if (o instanceof CharIdentity) { CharIdentity other = (CharIdentity)o; int result = super.compare(other); if (result == 0) { return (key - other.key); } else { return result; } } else if (o == null) { throw new ClassCastException("object is null"); } throw new ClassCastException(this.getClass().getName() + " != " + o.getClass().getName()); }
/** Determine the ordering of identity objects. * @param o Other identity * @return The relative ordering between the objects * @since 2.2 */ public int compareTo(Object o) { if (o instanceof ByteIdentity) { ByteIdentity other = (ByteIdentity)o; int result = super.compare(other); if (result == 0) { return (key - other.key); } else { return result; } } else if (o == null) { throw new ClassCastException("object is null"); } throw new ClassCastException(this.getClass().getName() + " != " + o.getClass().getName()); }
/** Determine the ordering of identity objects. * @param o Other identity * @return The relative ordering between the objects * @since 2.2 */ public int compareTo(Object o) { if (o instanceof StringIdentity) { StringIdentity other = (StringIdentity)o; int result = super.compare(other); if (result == 0) { return ((String)keyAsObject).compareTo((String)other.keyAsObject); } else { return result; } } else if (o == null) { throw new ClassCastException("object is null"); } throw new ClassCastException(this.getClass().getName() + " != " + o.getClass().getName()); }
/** Determine the ordering of identity objects. * @param o Other identity * @return The relative ordering between the objects * @since 2.2 */ public int compareTo(Object o) { if (o instanceof IntIdentity) { IntIdentity other = (IntIdentity)o; int result = super.compare(other); if (result == 0) { return (key - other.key); } else { return result; } } else if (o == null) { throw new ClassCastException("object is null"); } throw new ClassCastException(this.getClass().getName() + " != " + o.getClass().getName()); }
/** Determine the ordering of identity objects. * @param o Other identity * @return The relative ordering between the objects * @since 2.2 */ public int compareTo(Object o) { if (o instanceof ByteIdentity) { ByteIdentity other = (ByteIdentity)o; int result = super.compare(other); if (result == 0) { return (key - other.key); } else { return result; } } else if (o == null) { throw new ClassCastException("object is null"); } throw new ClassCastException(this.getClass().getName() + " != " + o.getClass().getName()); }
/** Determine the ordering of identity objects. * @param o Other identity * @return The relative ordering between the objects * @since 2.2 */ public int compareTo(Object o) { if (o instanceof ShortIdentity) { ShortIdentity other = (ShortIdentity)o; int result = super.compare(other); if (result == 0) { return (key - other.key); } else { return result; } } else if (o == null) { throw new ClassCastException("object is null"); } throw new ClassCastException(this.getClass().getName() + " != " + o.getClass().getName()); }
/** Determine the ordering of identity objects. * @param o Other identity * @return The relative ordering between the objects * @since 2.2 */ public int compareTo(Object o) { if (o instanceof CharIdentity) { CharIdentity other = (CharIdentity)o; int result = super.compare(other); if (result == 0) { return (key - other.key); } else { return result; } } else if (o == null) { throw new ClassCastException("object is null"); } throw new ClassCastException(this.getClass().getName() + " != " + o.getClass().getName()); }
/** Determine the ordering of identity objects. * @param o Other identity * @return The relative ordering between the objects * @since 2.2 */ public int compareTo(Object o) { if (o instanceof ShortIdentity) { ShortIdentity other = (ShortIdentity)o; int result = super.compare(other); if (result == 0) { return (key - other.key); } else { return result; } } else if (o == null) { throw new ClassCastException("object is null"); } throw new ClassCastException(this.getClass().getName() + " != " + o.getClass().getName()); }
/** Determine the ordering of identity objects. * @param o Other identity * @return The relative ordering between the objects * @since 2.2 */ public int compareTo(Object o) { if (o instanceof StringIdentity) { StringIdentity other = (StringIdentity)o; int result = super.compare(other); if (result == 0) { return ((String)keyAsObject).compareTo((String)other.keyAsObject); } else { return result; } } else if (o == null) { throw new ClassCastException("object is null"); } throw new ClassCastException(this.getClass().getName() + " != " + o.getClass().getName()); }
/** Determine the ordering of identity objects. * @param o Other identity * @return The relative ordering between the objects * @since 2.2 */ public int compareTo(Object o) { if (o instanceof LongIdentity) { LongIdentity other = (LongIdentity)o; int result = super.compare(other); if (result == 0) { long diff = key - other.key; if (diff == 0) { return 0; } else { if (diff < 0) { return -1; } else { return 1; } } } else { return result; } } else if (o == null) { throw new ClassCastException("object is null"); } throw new ClassCastException(this.getClass().getName() + " != " + o.getClass().getName()); }
/** Determine the ordering of identity objects. * @param o Other identity * @return The relative ordering between the objects * @since 2.2 */ public int compareTo(Object o) { if (o instanceof LongIdentity) { LongIdentity other = (LongIdentity)o; int result = super.compare(other); if (result == 0) { long diff = key - other.key; if (diff == 0) { return 0; } else { if (diff < 0) { return -1; } else { return 1; } } } else { return result; } } else if (o == null) { throw new ClassCastException("object is null"); } throw new ClassCastException(this.getClass().getName() + " != " + o.getClass().getName()); }
if (o instanceof ObjectIdentity) { ObjectIdentity other = (ObjectIdentity)o; int result = super.compare(other); if (result == 0) { if (other.keyAsObject instanceof Comparable &&
if (o instanceof ObjectIdentity) { ObjectIdentity other = (ObjectIdentity)o; int result = super.compare(other); if (result == 0) { if (other.keyAsObject instanceof Comparable &&