net.walend.collection
Interface Identitor

All Known Implementing Classes:
DefaultIdentitor, FreezableIdentitor, MapToFreezablesIdentitor

public interface Identitor

This interface proscribes utility methods for working with objects in collections.

In general, implementations should be stateless.

Since:
20010707
Author:
David Walend

Method Summary
 boolean equals(java.lang.Object ob1, java.lang.Object ob2)
          If ob1 and ob2 should be equal in this Collection, return true.
 int hashCode(java.lang.Object ob)
          Return a hash code for ob.
 boolean valueEquals(java.lang.Object ob1, java.lang.Object ob2)
          If ob1 and ob2 should be equal values in this Map, return true.
 

Method Detail

equals

public boolean equals(java.lang.Object ob1,
                      java.lang.Object ob2)
If ob1 and ob2 should be equal in this Collection, return true. Collections use this equals method for everything. Maps use this method for key equality.

This method should be reflexive: equals(a,a) should always be true.

This method should be symmetric: equals(a,b) should be the same as equals(b,a).


hashCode

public int hashCode(java.lang.Object ob)
Return a hash code for ob.

If equals(a,b) then hashCode(a) should equal hashCode(b).


valueEquals

public boolean valueEquals(java.lang.Object ob1,
                           java.lang.Object ob2)
If ob1 and ob2 should be equal values in this Map, return true. Maps use valueEquals to determine if two values are equal, but use eqauls() for keys.

This method should be reflexive: equalsValue(a,a) should always be true.

This method should be symmetric: equalsValue(a,b) should be the same as equalsValue(b,a).



Copyright (c) 2000, 2001, David Walend