Class FixedLeafBuilder
java.lang.Object
io.crums.util.mrkl.Builder
io.crums.util.mrkl.FixedLeafBuilder
-
Field Summary
Fields inherited from class io.crums.util.mrkl.Builder
copyOnWrite, data, digest, lock -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFixedLeafBuilder(String algo) FixedLeafBuilder(String algo, boolean copyOnWrite) FixedLeafBuilder(String algo, int leafWidth) FixedLeafBuilder(String algo, int leafWidth, boolean copyOnWrite) -
Method Summary
Methods inherited from class io.crums.util.mrkl.Builder
add, clear, completeTree, count, getHashAlgo, hash, hashWidth, item, level, levelSize, newByteArrayList
-
Constructor Details
-
FixedLeafBuilder
- Parameters:
algo-- Throws:
IllegalArgumentException
-
FixedLeafBuilder
- Parameters:
algo-- Throws:
IllegalArgumentException
-
FixedLeafBuilder
public FixedLeafBuilder(String algo, int leafWidth, boolean copyOnWrite) throws IllegalArgumentException - Parameters:
algo-copyOnWrite-- Throws:
IllegalArgumentException
-
FixedLeafBuilder
- Parameters:
algo-copyOnWrite-- Throws:
IllegalArgumentException
-
FixedLeafBuilder
-
-
Method Details
-
leafWidth
-
add
public int add(byte[] item, int off, int len) throws IllegalArgumentException, IndexOutOfBoundsException Description copied from class:BuilderAdds the specified item as the next leaf node are returns its leaf index.- Overrides:
addin classBuilder- Parameters:
item- the item's data (copied)off- starting offset intoitemlen- = leafWidth()- Returns:
- the item's leaf node index in the to-be built tree
- Throws:
IllegalArgumentException- iflen≠ leafWidth()IndexOutOfBoundsException
-
build
-
packageTree
- Overrides:
packageTreein classBuilder
-