|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--anthill.util.SHADigest | +--anthill.types.SHAHashedKeyword
The class SHAHashedKeyword
computes the digest (or hash)
of a specified string keyword, and enables various other classes
to compare keyword hashes and store them in a HashMap
or other collections in need of a hashCode method.
Field Summary | |
protected String |
keyword
The keyword for this SHAHashedKeyword object. |
Fields inherited from class anthill.util.SHADigest |
digest, DIGEST_SIZE, DIGEST_TYPE, hashcode, random, RANDOM_TYPE, rdigest |
Fields inherited from interface anthill.types.HashedKeyword |
NAME |
Constructor Summary | |
SHAHashedKeyword()
Default constructor for externalization. |
|
SHAHashedKeyword(boolean secure)
Creates a new SHAHashedKeyword instance based on a randomly
generated SHA-1 hash key. |
|
SHAHashedKeyword(boolean secure,
String keyword)
Compute a SHA-1 hash value for the specified keyword, or compute a random SHA-1 identifier if the keyword is equal to null. |
|
SHAHashedKeyword(Factory factory,
String name)
Default constructor for externalization. |
|
SHAHashedKeyword(String keyword)
Compute a SHA-1 hash value for the specified keyword, or compute a random SHA-1 identifier if the keyword is equal to null. |
Method Summary | |
String |
getKeyword()
Returns the keyword associated with this SHAHashedKeyword object. |
void |
init(boolean secure,
String keyword)
|
void |
init(String keyword)
Initializes the hashed keyword by setting the keyword contained in it. |
void |
readExternal(ObjectInput in)
Marshals this SHAHashedKeyword to the specified output stream. |
String |
toString()
Returns a string representation of the object. |
void |
writeExternal(ObjectOutput out)
Marshals this SHAHashedKeyword to the specified output stream. |
Methods inherited from class anthill.util.SHADigest |
compareTo, compareTo, computeDigest, computeHash, computeRandomSHA, equals, getBytes, hashCode, initRandom, isCloser |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface anthill.types.HashedKeyword |
getBytes |
Methods inherited from interface java.lang.Comparable |
compareTo |
Methods inherited from interface anthill.types.Closeness |
isCloser |
Field Detail |
protected String keyword
SHAHashedKeyword
object.
Constructor Detail |
public SHAHashedKeyword()
public SHAHashedKeyword(Factory factory, String name)
public SHAHashedKeyword(boolean secure)
SHAHashedKeyword
instance based on a randomly
generated SHA-1 hash key.
secure
- if true, the secure random generator will be used;
otherwise the standard random generator is used.public SHAHashedKeyword(String keyword)
keyword
- A string keyword to be hashed and stored in this object.public SHAHashedKeyword(boolean secure, String keyword)
secure
- if true, the secure random generator will be used;
otherwise the standard random generator is used.keyword
- a string keyword to be hashed and stored in this object.Method Detail |
public void init(String keyword)
HashedKeyword
init
in interface HashedKeyword
public void init(boolean secure, String keyword)
public String getKeyword()
SHAHashedKeyword
object.
getKeyword
in interface HashedKeyword
SHAHashedKeyword
.public String toString()
toString
in class SHADigest
public void readExternal(ObjectInput in) throws IOException
SHAHashedKeyword
to the specified output stream.
readExternal
in interface Externalizable
readExternal
in class SHADigest
in
- an ObjectInput
stream object
IOException
- if an error occurspublic void writeExternal(ObjectOutput out) throws IOException
SHAHashedKeyword
to the specified output stream.
writeExternal
in interface Externalizable
writeExternal
in class SHADigest
out
- an ObjectOutput
stream object
IOException
- if an error occurs
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |