Constructor and Description |
---|
HashCode() |
Modifier and Type | Method and Description |
---|---|
HashCode |
add(int i)
Hashes the hashcode into this object.
|
HashCode |
add(Object o)
Hashes the hashcode of the specified object into this object.
|
static HashCode |
create()
Create a new HashCode object.
|
int |
get()
Return the calculated hashcode value.
|
static int |
of(Object... objects)
Calculates a hash code over the specified objects.
|
protected Object |
unswap(Object o)
Converts the object to a normalized form before grabbing it's hashcode.
|
public HashCode()
public static final HashCode create()
public static final int of(Object... objects)
objects
- The objects to calculate a hashcode over.public HashCode add(Object o)
o
- The object whose hashcode will be hashed with this object.public HashCode add(int i)
The formula is simply
i
- The hashcode to hash into this object's hashcode.public int get()
protected Object unswap(Object o)
Subclasses can override this method to provide specialized handling (e.g. converting numbers to strings so that
Default implementation does nothing.
o
- The object to normalize before getting it's hashcode.Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.