net.spy.memcached
Class HashAlgorithmRegistry

java.lang.Object
  extended by net.spy.memcached.HashAlgorithmRegistry

public final class HashAlgorithmRegistry
extends java.lang.Object

Registry of known hashing algorithms for locating a server for a key. Useful when configuring from files using algorithm names.

Please, make sure you register your algorithm with { registerHashAlgorithm(String, HashAlgorithm) before referring to it by name


Method Summary
static HashAlgorithm lookupHashAlgorithm(java.lang.String name)
          Tries to find selected hash algorithm using name provided.
static void registerHashAlgorithm(java.lang.String name, HashAlgorithm alg)
          Registers provided HashAlgorithm instance with the given name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

registerHashAlgorithm

public static void registerHashAlgorithm(java.lang.String name,
                                         HashAlgorithm alg)
Registers provided HashAlgorithm instance with the given name. Name is not case sensitive. Any registered algorithm with the same name will be substituted

Parameters:
name - name of the algorithm
alg - algorithm instance to register

lookupHashAlgorithm

public static HashAlgorithm lookupHashAlgorithm(java.lang.String name)
Tries to find selected hash algorithm using name provided.

Note, that lookup is being performed using name's lower-case value

Parameters:
name - the algorithm name to be used for lookup
Returns:
a HashAlgorithm instance or null if there's no algorithm with the specified name


Copyright © 2006-2009 Dustin Sallings, 2009-2012 Couchbase, Inc.