Class FixedLeafBuilder

java.lang.Object
io.crums.util.mrkl.Builder
io.crums.util.mrkl.FixedLeafBuilder
Direct Known Subclasses:
DeltaBuilder

public class FixedLeafBuilder
extends Builder
  • Constructor Details

    • FixedLeafBuilder

      public FixedLeafBuilder​(java.lang.String algo)
      Parameters:
      algo -
      Throws:
      java.lang.IllegalArgumentException
    • FixedLeafBuilder

      public FixedLeafBuilder​(java.lang.String algo, int leafWidth) throws java.lang.IllegalArgumentException
      Parameters:
      algo -
      Throws:
      java.lang.IllegalArgumentException
    • FixedLeafBuilder

      public FixedLeafBuilder​(java.lang.String algo, int leafWidth, boolean copyOnWrite) throws java.lang.IllegalArgumentException
      Parameters:
      algo -
      copyOnWrite -
      Throws:
      java.lang.IllegalArgumentException
    • FixedLeafBuilder

      public FixedLeafBuilder​(java.lang.String algo, boolean copyOnWrite) throws java.lang.IllegalArgumentException
      Parameters:
      algo -
      copyOnWrite -
      Throws:
      java.lang.IllegalArgumentException
    • FixedLeafBuilder

      protected FixedLeafBuilder​(FixedLeafBuilder copy)
  • Method Details

    • leafWidth

      public int leafWidth()
      Overrides:
      leafWidth in class Builder
    • add

      public int add​(byte[] item, int off, int len) throws java.lang.IllegalArgumentException, java.lang.IndexOutOfBoundsException
      Description copied from class: Builder
      Adds the specified item as the next leaf node are returns its leaf index.
      Overrides:
      add in class Builder
      Parameters:
      len - = leafWidth()
      item - the item's data (copied)
      off - starting offset into item
      Returns:
      the item's leaf node index in the to-be built tree
      Throws:
      java.lang.IllegalArgumentException - if lenleafWidth()
      java.lang.IndexOutOfBoundsException
    • build

      public Tree build()
      Description copied from class: Builder
      Builds and returns the tree. On return the builder is cleared.
      Overrides:
      build in class Builder
      See Also:
      Builder.clear()
    • packageTree

      protected Tree packageTree()
      Overrides:
      packageTree in class Builder