RECODER 0.92

recoder.util
Class Order.Identity

java.lang.Object
  extended by recoder.util.Order.Identity
All Implemented Interfaces:
Equality, HashCode, Order
Enclosing interface:
Order

public static class Order.Identity
extends java.lang.Object
implements Order, HashCode

Identity order implementation comparing objects by address. The implementation uses System.identityHashCode and implements HashCode. The order is based upon this encoding which allows retrieval of objects but has no further meaning. Note that x != null implies less(null, x) and of course equals(null, null).


Nested Class Summary
 
Nested classes/interfaces inherited from interface recoder.util.Order
Order.CustomLexicalOrder, Order.Identity, Order.Lexical, Order.Natural
 
Field Summary
 
Fields inherited from interface recoder.util.Order
IDENTITY, LEXICAL, NATURAL
 
Fields inherited from interface recoder.util.HashCode
IDENTITY, NATURAL
 
Constructor Summary
Order.Identity()
           
 
Method Summary
 boolean equals(java.lang.Object x, java.lang.Object y)
          Compares two objects for equality.
 boolean greater(java.lang.Object x, java.lang.Object y)
          Check if the first object is greater than the second one.
 boolean greaterOrEquals(java.lang.Object x, java.lang.Object y)
          Check if the first object is greater than or equals the second one.
 int hashCode(java.lang.Object x)
          Return an integer value representing the object.
 boolean isComparable(java.lang.Object x, java.lang.Object y)
          Check if both objects can be related.
 boolean less(java.lang.Object x, java.lang.Object y)
          Check if the first object is less than the second one.
 boolean lessOrEquals(java.lang.Object x, java.lang.Object y)
          Check if the first object is less than or equals the second one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Order.Identity

public Order.Identity()
Method Detail

equals

public final boolean equals(java.lang.Object x,
                            java.lang.Object y)
Description copied from interface: Equality
Compares two objects for equality.

Specified by:
equals in interface Equality
Parameters:
x - the first object.
y - the second object.
Returns:
true, if x equals y, false otherwise.

hashCode

public final int hashCode(java.lang.Object x)
Description copied from interface: HashCode
Return an integer value representing the object.

Specified by:
hashCode in interface HashCode
Parameters:
x - an object.
Returns:
the hash code.

isComparable

public final boolean isComparable(java.lang.Object x,
                                  java.lang.Object y)
Description copied from interface: Order
Check if both objects can be related.

Specified by:
isComparable in interface Order
Parameters:
x - the first object.
y - the second object.
Returns:
true if both objects can be compared, false otherwise.

less

public final boolean less(java.lang.Object x,
                          java.lang.Object y)
Description copied from interface: Order
Check if the first object is less than the second one. This comparison is strict: less(x, y) implies !equals(x, y) .

Specified by:
less in interface Order
Parameters:
x - the first object.
y - the second object.
Returns:
true if the first object is less than the second one.

greater

public final boolean greater(java.lang.Object x,
                             java.lang.Object y)
Description copied from interface: Order
Check if the first object is greater than the second one. This comparison is strict: greater(x, y) implies !equals(x, y).

Specified by:
greater in interface Order
Parameters:
x - the first object.
y - the second object.
Returns:
true if the first object is greater than the second one.

lessOrEquals

public final boolean lessOrEquals(java.lang.Object x,
                                  java.lang.Object y)
Description copied from interface: Order
Check if the first object is less than or equals the second one.

Specified by:
lessOrEquals in interface Order
Parameters:
x - the first object.
y - the second object.
Returns:
true if the first object is less than or equals the second one.

greaterOrEquals

public final boolean greaterOrEquals(java.lang.Object x,
                                     java.lang.Object y)
Description copied from interface: Order
Check if the first object is greater than or equals the second one.

Specified by:
greaterOrEquals in interface Order
Parameters:
x - the first object.
y - the second object.
Returns:
true if the first object is greater than or equals the second one.

RECODER 0.92