Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.util
Class BooleanList

java.lang.Object
  extended by com.jivesoftware.util.BooleanList

public class BooleanList
extends java.lang.Object

A simplified List for boolean values. Only the bare number of methods needed by Jive have been implemented so far, so additional implementation work would be welcome.

The implementation uses an array for maximum speed. If the number of elements grows larger than capacity, the capacity will automatically grow.


Constructor Summary
BooleanList()
          Creates a new list of boolean values with a default capacity of 50.
BooleanList(int initialCapacity)
          Creates a new list of boolean values with a specified initial capacity.
 
Method Summary
 void add(boolean value)
          Adds a new boolean value to the end of the list.
 boolean get(int index)
          Returns the boolean value at the specified index.
 int size()
          Returns the number of elements in the list.
 boolean[] toArray()
          Returns a new array containing the list elements.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BooleanList

public BooleanList()
Creates a new list of boolean values with a default capacity of 50.


BooleanList

public BooleanList(int initialCapacity)
Creates a new list of boolean values with a specified initial capacity.

Parameters:
initialCapacity - a capacity to initialize the list with.
Method Detail

add

public void add(boolean value)
Adds a new boolean value to the end of the list.


get

public boolean get(int index)
Returns the boolean value at the specified index. If the index is not valid, an IndexOutOfBoundException will be thrown.

Parameters:
index - the index of the value to return.
Returns:
the value at the specified index.

size

public int size()
Returns the number of elements in the list.

Returns:
the number of elements in the list.

toArray

public boolean[] toArray()
Returns a new array containing the list elements.

Returns:
an array of the list elements.

toString

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

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.