Package org.apache.juneau.internal
Class HashCode
java.lang.Object
org.apache.juneau.internal.HashCode
Utility class for generating integer hash codes.
 
General usage:
   
See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionadd(int i) Hashes the hashcode into this object.Hashes the hashcode of the specified object into this object.static final HashCodecreate()Create a new HashCode object.intget()Return the calculated hashcode value.static final intCalculates a hash code over the specified objects.protected ObjectConverts the object to a normalized form before grabbing it's hashcode.
- 
Constructor Details- 
HashCodepublic HashCode()
 
- 
- 
Method Details- 
createCreate a new HashCode object.- Returns:
- A new HashCode object.
 
- 
ofCalculates a hash code over the specified objects.- Parameters:
- objects- The objects to calculate a hashcode over.
- Returns:
- A numerical hashcode value.
 
- 
addHashes the hashcode of the specified object into this object.- Parameters:
- o- The object whose hashcode will be hashed with this object.
- Returns:
- This object.
 
- 
addHashes the hashcode into this object.The formula is simply hashCode = 31*hashCode + i; - Parameters:
- i- The hashcode to hash into this object's hashcode.
- Returns:
- This object.
 
- 
getReturn the calculated hashcode value.- Returns:
- The calculated hashcode.
 
- 
unswapConverts the object to a normalized form before grabbing it's hashcode.Subclasses can override this method to provide specialized handling (e.g. converting numbers to strings so that 123 and"123" end up creating the same hashcode.)Default implementation does nothing. - Parameters:
- o- The object to normalize before getting it's hashcode.
- Returns:
- The normalized object.
 
 
-