Class DoubleList

java.lang.Object
org.basex.util.list.ElementList
org.basex.util.list.DoubleList

public class DoubleList extends ElementList
Resizable-array implementation for native double values.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Field Details

    • list

      protected double[] list
      Element container.
  • Constructor Details

    • DoubleList

      public DoubleList()
      Default constructor.
    • DoubleList

      public DoubleList(long capacity)
      Constructor with initial capacity.
      Parameters:
      capacity - array capacity
  • Method Details

    • add

      public final DoubleList add(double element)
      Adds an element to the array.
      Parameters:
      element - element to be added
      Returns:
      self reference
    • add

      public final DoubleList add(double... elements)
      Adds elements to the array.
      Parameters:
      elements - elements to be added
      Returns:
      self reference
    • get

      public final double get(int index)
      Returns the element at the specified position.
      Parameters:
      index - index of the element to return
      Returns:
      element
    • toArray

      public final double[] toArray()
      Returns an array with all elements.
      Returns:
      array
    • finish

      public double[] finish()
      Returns an array with all elements and invalidates the internal array. Warning: the function must only be called if the list is discarded afterwards.
      Returns:
      array (internal representation!)
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object