Class ElementList

java.lang.Object
org.basex.util.list.ElementList
Direct Known Subclasses:
Atts, BoolList, ByteList, DoubleList, IntList, LongList, ObjectList

public abstract class ElementList extends Object
This is an abstract class for storing elements of any kind in an array-based list.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected double
    Resize factor for extending arrays.
    protected int
    Number of elements.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Tests whether the container has no elements.
    protected final int
    Returns a new array size.
    protected final int
    newCapacity(int min)
    Returns a new array size that is larger than or equal to the specified size.
    final void
    Resets the array size.
    final int
    Returns the number of elements.
    final void
    size(int sz)
    Enforces the number of elements.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • factor

      protected double factor
      Resize factor for extending arrays.
    • size

      protected int size
      Number of elements.
  • Constructor Details

    • ElementList

      protected ElementList()
      Default constructor.
  • Method Details

    • newCapacity

      protected final int newCapacity()
      Returns a new array size.
      Returns:
      new array size
    • newCapacity

      protected final int newCapacity(int min)
      Returns a new array size that is larger than or equal to the specified size.
      Parameters:
      min - minimum size
      Returns:
      new array size
    • size

      public final int size()
      Returns the number of elements.
      Returns:
      number of elements
    • size

      public final void size(int sz)
      Enforces the number of elements.
      Parameters:
      sz - number of elements
    • isEmpty

      public final boolean isEmpty()
      Tests whether the container has no elements.
      Returns:
      result of check
    • reset

      public final void reset()
      Resets the array size.