Klasse ObjectStrategy.IdentityStrategy<T>

java.lang.Object
speiger.src.collections.objects.utils.ObjectStrategy.IdentityStrategy<T>
Typparameter:
T - the keyType of elements maintained by this Collection
Alle implementierten Schnittstellen:
ObjectStrategy<T>
Umschließende Schnittstelle:
ObjectStrategy<T>

public static class ObjectStrategy.IdentityStrategy<T> extends Object implements ObjectStrategy<T>
A Strategy that uses Identity HashCode instead of the normal hashing function. This simulates a IdentityHashMap without having the need to actually implement it.
  • Konstruktordetails

    • IdentityStrategy

      public IdentityStrategy()
  • Methodendetails

    • hashCode

      public int hashCode(T o)
      Beschreibung aus Schnittstelle kopiert: ObjectStrategy
      Type Specific HashCode function
      Angegeben von:
      hashCode in Schnittstelle ObjectStrategy<T>
      Parameter:
      o - the element that the hashcode is requested for (if object may be null)
      Gibt zurück:
      hashcode for the given entry
    • equals

      public boolean equals(T key, T value)
      Beschreibung aus Schnittstelle kopiert: ObjectStrategy
      Type Specific Equals function
      Angegeben von:
      equals in Schnittstelle ObjectStrategy<T>
      Parameter:
      key - the first element that should be compared with
      value - the second element that should be compared with (if object may be null)
      Gibt zurück:
      if the elements match