|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.tomp2p.rpc.DigestInfo
public class DigestInfo
Calculates or sets a global hash. The digest is used in two places: for routing, where a message needs to have a predictable size. Thus in this case a global hash is calculated. The second usage is get() for getting a list of hashes from peers. Here we don't need to restrict ourself, since we use TCP.
Constructor Summary | |
---|---|
DigestInfo()
Empty constructor is used to add the hashes to the list. |
|
DigestInfo(int size)
Create a digest with the size only. |
|
DigestInfo(Number160 keyDigest,
Number160 contentDigest,
int size)
If a global hash has already been calculated, then this constructor is used to store those. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
SimpleBloomFilter<Number160> |
getContentBloomFilter(int bitArraySize,
int expectedElements)
|
Number160 |
getContentDigest()
|
Map<Number160,Number160> |
getDigests()
|
SimpleBloomFilter<Number160> |
getKeyBloomFilter(int bitArraySize,
int expectedElements)
|
Number160 |
getKeyDigest()
|
int |
getSize()
|
int |
hashCode()
|
boolean |
isEmpty()
|
void |
put(Number160 key,
Number160 content)
Stores a key and the hash of the content for further processing |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DigestInfo()
public DigestInfo(int size)
size
- public DigestInfo(Number160 keyDigest, Number160 contentDigest, int size)
keyDigest
- contentDigest
- size
- Method Detail |
---|
public Number160 getKeyDigest()
public Number160 getContentDigest()
public SimpleBloomFilter<Number160> getKeyBloomFilter(int bitArraySize, int expectedElements)
public SimpleBloomFilter<Number160> getContentBloomFilter(int bitArraySize, int expectedElements)
public void put(Number160 key, Number160 content)
key
- The key of the contentcontent
- The hash of the contentpublic Map<Number160,Number160> getDigests()
public int getSize()
public boolean isEmpty()
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |