Package com.scurrilous.circe.impl
Class AbstractStatelessIntHash
- java.lang.Object
- 
- com.scurrilous.circe.impl.AbstractStatelessIntHash
 
- 
- All Implemented Interfaces:
- Hash,- StatelessHash,- StatelessIntHash
 
 public abstract class AbstractStatelessIntHash extends java.lang.Object implements StatelessIntHash Base implementation for stateless (but not incremental) integer hash functions.
- 
- 
Constructor SummaryConstructors Constructor Description AbstractStatelessIntHash()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intcalculate(byte[] input)Evaluates this hash function for the entire given input array.intcalculate(byte[] input, int index, int length)Evaluates this hash function for the given range of the given input array.intcalculate(long address, long length)Evaluates this hash function for the memory with the given address and length.intcalculate(java.nio.ByteBuffer input)Evaluates this hash function with the remaining contents of the given input buffer.protected abstract intcalculateUnchecked(byte[] input, int index, int length)Evaluates this hash function for the given range of the given input array.booleansupportsUnsafe()Returns whether this hash function supports unsafe access to arbitrary memory addresses using methods such asStatefulHash.update(long, long),StatelessIntHash.calculate(long, long), orIncrementalIntHash.resume(int, long, long).- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface com.scurrilous.circe.StatelessIntHashcreateStateful
 
- 
 
- 
- 
- 
Method Detail- 
supportsUnsafepublic boolean supportsUnsafe() Description copied from interface:HashReturns whether this hash function supports unsafe access to arbitrary memory addresses using methods such asStatefulHash.update(long, long),StatelessIntHash.calculate(long, long), orIncrementalIntHash.resume(int, long, long). Such functions are generally implemented in native code.- Specified by:
- supportsUnsafein interface- Hash
- Returns:
- true if unsafe access is supported, false if not
 
 - 
calculatepublic int calculate(byte[] input) Description copied from interface:StatelessIntHashEvaluates this hash function for the entire given input array.- Specified by:
- calculatein interface- StatelessIntHash
- Parameters:
- input- the input array
- Returns:
- the output of the hash function
 
 - 
calculatepublic int calculate(byte[] input, int index, int length)Description copied from interface:StatelessIntHashEvaluates this hash function for the given range of the given input array.- Specified by:
- calculatein interface- StatelessIntHash
- Parameters:
- input- the input array
- index- the starting index of the first input byte
- length- the length of the input range
- Returns:
- the output of the hash function
 
 - 
calculatepublic int calculate(java.nio.ByteBuffer input) Description copied from interface:StatelessIntHashEvaluates this hash function with the remaining contents of the given input buffer. This method leaves the buffer position at the limit.- Specified by:
- calculatein interface- StatelessIntHash
- Parameters:
- input- the input buffer
- Returns:
- the output of the hash function
 
 - 
calculatepublic int calculate(long address, long length)Description copied from interface:StatelessIntHashEvaluates this hash function for the memory with the given address and length. The arguments are generally not checked in any way and will likely lead to a VM crash or undefined results if invalid.- Specified by:
- calculatein interface- StatelessIntHash
- Parameters:
- address- the base address of the input
- length- the length of the input
- Returns:
- the output of the hash function
- See Also:
- Hash.supportsUnsafe()
 
 - 
calculateUncheckedprotected abstract int calculateUnchecked(byte[] input, int index, int length)Evaluates this hash function for the given range of the given input array. The index and length parameters have already been validated.- Parameters:
- input- the input array
- index- the starting index of the first input byte
- length- the length of the input range
- Returns:
- the output of the hash function
 
 
- 
 
-