Package org.basex.util.list
Class ElementList
java.lang.Object
org.basex.util.list.ElementList
- Direct Known Subclasses:
Atts,BoolList,ByteList,DoubleList,IntList,LongList,ObjectList
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanisEmpty()Tests whether the container has no elements.protected final intReturns a new array size.protected final intnewCapacity(int min) Returns a new array size that is larger than or equal to the specified size.final voidreset()Resets the array size.final intsize()Returns the number of elements.final voidsize(int sz) Enforces the number of elements.
-
Field Details
-
factor
protected double factorResize factor for extending arrays. -
size
protected int sizeNumber 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.
-