org.infinispan.distribution.ch
Class ExperimentalDefaultConsistentHash.Entry

java.lang.Object
  extended by org.infinispan.distribution.ch.ExperimentalDefaultConsistentHash.Entry
All Implemented Interfaces:
Comparable<ExperimentalDefaultConsistentHash.Entry>
Enclosing class:
ExperimentalDefaultConsistentHash

public static class ExperimentalDefaultConsistentHash.Entry
extends Object
implements Comparable<ExperimentalDefaultConsistentHash.Entry>

An entry into a consistent hash. It wraps the original object, the object's hash as used to generate the consistent hash, the value extracted from the object used to generate the hash, and the modifier used to differentiate the hash.


Field Summary
 Address address
           
 int differentiator
           
 int hash
           
 String string
           
 
Constructor Summary
ExperimentalDefaultConsistentHash.Entry(Address address, String string, int differentiator, int hash)
           
 
Method Summary
 int compareTo(ExperimentalDefaultConsistentHash.Entry other)
          Compare this Entry with another Entry.
 boolean equals(Object other)
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

differentiator

public final int differentiator

hash

public final int hash

address

public final Address address

string

public final String string
Constructor Detail

ExperimentalDefaultConsistentHash.Entry

public ExperimentalDefaultConsistentHash.Entry(Address address,
                                               String string,
                                               int differentiator,
                                               int hash)
Method Detail

compareTo

public int compareTo(ExperimentalDefaultConsistentHash.Entry other)
Compare this Entry with another Entry. First the hash values are compared, then the differentiator is compared. if the hash values are equal.

Specified by:
compareTo in interface Comparable<ExperimentalDefaultConsistentHash.Entry>
Parameters:
other - An Entry object to be compared with this object. Returns
  • -1 if this Entry is less than the other Entry.
  • 0 if they are equal.
  • +1 if this Entry is greater than the other Entry.
Returns:

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011 JBoss, a division of Red Hat. All Rights Reserved.