Package com.nt.udc.nar
Class NARKey
java.lang.Object
com.nt.udc.nar.NARKey
- All Implemented Interfaces:
Serializable
This class implements a simple NAR key. For the most part, this
class should be used when the user needs to deal with a set
of NAR's, but would like to access them via a key, rather than
by searching (such as in a Hashtable-type Object).
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
keyvalue
protected byte[] keyvalue -
hash
protected int hash -
hash_made
protected boolean hash_made
-
-
Constructor Details
-
NARKey
public NARKey(byte[] value) Use this constructor when you already have a set of bytes that qualifies as the hash code.- Parameters:
value
- Bytes, to be used as the hash code
-
NARKey
Creates a NAR Key from the given NAR, using the given attributes to build the key.- Parameters:
nar
- NAR to build the key from.attrs
- Attributes to use when building the key.- Throws:
NullPointerException
-
NARKey
-
-
Method Details
-
toBytes
public byte[] toBytes()Returns the byte array value for this key. -
hashCode
public int hashCode()Returns the hash code of this NARKey. -
equals
Tests for equality among 2 NARKeys. Although this method allows any Object as a parameter, this method will always return false if the parameter is not a NARKey object. -
toString
Converts this key to a String.
-