org.infinispan.distribution
Class ExperimentalDefaultConsistentHash.Entry
java.lang.Object
org.infinispan.distribution.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.
differentiator
public final int differentiator
hash
public final int hash
address
public final Address address
string
public final String string
ExperimentalDefaultConsistentHash.Entry
public ExperimentalDefaultConsistentHash.Entry(Address address,
String string,
int differentiator,
int hash)
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 © 2010 JBoss, a division of Red Hat. All Rights Reserved.