Class TreeSeqBuilder

java.lang.Object
org.basex.query.value.seq.tree.TreeSeqBuilder
All Implemented Interfaces:
Iterable<Item>

public final class TreeSeqBuilder extends Object implements Iterable<Item>
A builder for creating a Sequence (with at least 2 items) by prepending and appending Items.
Author:
BaseX Team 2005-21, BSD License, Leo Woerteler
  • Constructor Details

    • TreeSeqBuilder

      public TreeSeqBuilder()
  • Method Details

    • concat

      public static Seq concat(Item item1, Item item2)
      Concatenates two items.
      Parameters:
      item1 - first item
      item2 - second item
      Returns:
      the value
    • addFront

      public TreeSeqBuilder addFront(Item item)
      Adds an item to the start of the array.
      Parameters:
      item - item to add
      Returns:
      reference to this builder for convenience
    • add

      public TreeSeqBuilder add(Item item)
      Adds an item to the end of the array.
      Parameters:
      item - item to add
      Returns:
      reference to this builder for convenience
    • add

      public TreeSeqBuilder add(Value value, QueryContext qc)
      Appends the items of the given value to this builder.
      Parameters:
      value - value to append
      qc - query context
      Returns:
      this builder for convenience
    • seq

      public Seq seq(Type type)
      Creates a sequence containing the current elements of this builder.
      Parameters:
      type - type of all items in this sequence, can be null
      Returns:
      resulting sequence
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • iterator

      public Iterator<Item> iterator()
      Specified by:
      iterator in interface Iterable<Item>