org.basex.util.list
Class BoolList

java.lang.Object
  extended by org.basex.util.list.ElementList
      extended by org.basex.util.list.BoolList

public final class BoolList
extends ElementList

This is a simple container for native booleans.

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

Field Summary
 
Fields inherited from class org.basex.util.list.ElementList
factor, size
 
Constructor Summary
BoolList()
          Default constructor.
BoolList(int capacity)
          Constructor, specifying an initial internal array size.
 
Method Summary
 void add(boolean element)
          Adds an element.
 boolean get(int index)
          Returns the element at the specified index.
 boolean peek()
          Returns the uppermost element on the stack, without removing it.
 boolean pop()
          Pops the uppermost element from the stack.
 void push(boolean element)
          Pushes an element onto the stack.
 void set(int index, boolean element)
          Stores an element at the specified index.
 boolean[] toArray()
          Finishes the int array.
 java.lang.String toString()
           
 
Methods inherited from class org.basex.util.list.ElementList
isEmpty, newSize, newSize, reset, size, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BoolList

public BoolList()
Default constructor.


BoolList

public BoolList(int capacity)
Constructor, specifying an initial internal array size.

Parameters:
capacity - initial array capacity
Method Detail

add

public void add(boolean element)
Adds an element.

Parameters:
element - element to be added

get

public boolean get(int index)
Returns the element at the specified index.

Parameters:
index - index of the element to return
Returns:
element

set

public void set(int index,
                boolean element)
Stores an element at the specified index.

Parameters:
index - index of the element to replace
element - element to be stored

pop

public boolean pop()
Pops the uppermost element from the stack.

Returns:
the popped element

push

public void push(boolean element)
Pushes an element onto the stack.

Parameters:
element - element

peek

public boolean peek()
Returns the uppermost element on the stack, without removing it.

Returns:
uppermost element

toArray

public boolean[] toArray()
Finishes the int array.

Returns:
int array

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object