Package com.scurrilous.circe.crc
Class StandardCrcProvider
- java.lang.Object
-
- com.scurrilous.circe.impl.AbstractHashProvider<CrcParameters>
-
- com.scurrilous.circe.crc.StandardCrcProvider
-
- All Implemented Interfaces:
HashProvider
public final class StandardCrcProvider extends AbstractHashProvider<CrcParameters>
Provides pure Java and JDK-supplied CRC implementations.
-
-
Constructor Summary
Constructors Constructor Description StandardCrcProvider()Constructs a newStandardCrcProvider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StatelessHashcreateCacheable(CrcParameters params, java.util.EnumSet<HashSupport> required)Called byAbstractHashProvider.getCacheable(P, java.util.EnumSet<com.scurrilous.circe.HashSupport>)to create new cacheable stateless hash functions.protected Hashget(CrcParameters params, java.util.EnumSet<HashSupport> required)Requests a hash function using the given parameters and support flags.protected java.util.EnumSet<HashSupport>querySupportTyped(CrcParameters params)Implemented by subclasses to provide information about the available implementations corresponding to the given hash algorithm parameters.-
Methods inherited from class com.scurrilous.circe.impl.AbstractHashProvider
createStateful, getCacheable, getIncrementalInt, getIncrementalLong, getStatelessInt, getStatelessLong, querySupport
-
-
-
-
Constructor Detail
-
StandardCrcProvider
public StandardCrcProvider()
Constructs a newStandardCrcProvider.
-
-
Method Detail
-
querySupportTyped
protected java.util.EnumSet<HashSupport> querySupportTyped(CrcParameters params)
Description copied from class:AbstractHashProviderImplemented by subclasses to provide information about the available implementations corresponding to the given hash algorithm parameters. Called byAbstractHashProvider.querySupport(com.scurrilous.circe.HashParameters)if the hash parameters match the base type supported by this provider.- Specified by:
querySupportTypedin classAbstractHashProvider<CrcParameters>- Parameters:
params- the hash algorithm parameters- Returns:
- a set of flags indicating the level of support
-
get
protected Hash get(CrcParameters params, java.util.EnumSet<HashSupport> required)
Description copied from class:AbstractHashProviderRequests a hash function using the given parameters and support flags. This method is only responsible for checking support flags returned byAbstractHashProvider.querySupportTyped(P).To support caching of stateless hash functions, call
AbstractHashProvider.getCacheable(P, java.util.EnumSet<com.scurrilous.circe.HashSupport>)from this method and implementAbstractHashProvider.createCacheable(P, java.util.EnumSet<com.scurrilous.circe.HashSupport>).- Specified by:
getin classAbstractHashProvider<CrcParameters>- Parameters:
params- the hash algorithm parametersrequired- the required hash support flags- Returns:
- a hash function
-
createCacheable
protected StatelessHash createCacheable(CrcParameters params, java.util.EnumSet<HashSupport> required)
Description copied from class:AbstractHashProviderCalled byAbstractHashProvider.getCacheable(P, java.util.EnumSet<com.scurrilous.circe.HashSupport>)to create new cacheable stateless hash functions. The default implementation simply throwsUnsupportedOperationException.- Overrides:
createCacheablein classAbstractHashProvider<CrcParameters>- Parameters:
params- the hash algorithm parametersrequired- the required hash support flags- Returns:
- a stateless hash function
-
-