Class ArrayBuilder

java.lang.Object
org.basex.query.value.array.ArrayBuilder

public final class ArrayBuilder extends Object
A builder for creating an XQArray by prepending and appending elements.
Author:
BaseX Team 2005-21, BSD License, Leo Woerteler
  • Constructor Details

    • ArrayBuilder

      public ArrayBuilder()
  • Method Details

    • prepend

      public void prepend(Value elem)
      Adds an element to the start of the array.
      Parameters:
      elem - element to add
    • append

      public void append(Value elem)
      Adds an element to the end of the array.
      Parameters:
      elem - element to add
    • append

      public void append(XQArray arr)
      Appends the given array to this builder.
      Parameters:
      arr - array to append
    • freeze

      public XQArray freeze()
      Creates an XQArray containing the elements of this builder.
      Returns:
      resulting array
    • toString

      public String toString()
      Overrides:
      toString in class Object