org.basex.util.list
Class ElementList

java.lang.Object
  extended by org.basex.util.list.ElementList
Direct Known Subclasses:
Ann, ANodeList, Atts, BoolList, ByteList, ExprList, FTMatch, FTMatches, FTTokens, IntList, StringList, TokenList, ValueList, VarStack

public abstract class ElementList
extends java.lang.Object

This is an abstract class for storing elements of any kind in an array-based list.

Author:
BaseX Team 2005-13, BSD License, Christian Gruen

Field Summary
protected  double factor
          Resize factor for extending the arrays.
protected  int size
          Number of elements.
 
Constructor Summary
protected ElementList()
          Default constructor.
 
Method Summary
 boolean isEmpty()
          Tests is the container has no elements.
protected  int newSize()
          Returns a new array size.
protected  int newSize(int min)
          Returns a new array size that is larger than or equal to the specified size.
 void reset()
          Resets the array size.
 int size()
          Returns the number of elements.
 void size(int s)
          Enforces the number of elements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

factor

protected double factor
Resize factor for extending the arrays.


size

protected int size
Number of elements.

Constructor Detail

ElementList

protected ElementList()
Default constructor.

Method Detail

newSize

protected final int newSize()
Returns a new array size.

Returns:
new array size

newSize

protected final int newSize(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 s)
Enforces the number of elements.

Parameters:
s - number of elements

isEmpty

public final boolean isEmpty()
Tests is the container has no elements.

Returns:
result of check

reset

public final void reset()
Resets the array size.