OpenOffice.org
XMerge API

org.openoffice.xmerge.util
Class IntArrayList

java.lang.Object
  |
  +--org.openoffice.xmerge.util.IntArrayList

public class IntArrayList
extends java.lang.Object

This is a convenience class used to create an ArrayList of integers.


Constructor Summary
IntArrayList()
          Constructor.
IntArrayList(int initialCapacity)
          Constructor.
 
Method Summary
 void add(int value)
          This method appends an element to the list.
 void ensureCapacity(int minCapacity)
          This method ensures that the list is large enough for minCapacity elements.
 void ensureCapacityAndFill(int minCapacity, int fillValue)
          This method ensures that the list is large enough for minCapacity elements.
 int get(int index)
          This method gets the integer value stored in element index.
 void set(int index, int value)
          This method sets an element of the list to the input integer value.
 int size()
          This method gets the size of the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntArrayList

public IntArrayList()
Constructor. Creates the list with 0 length.

IntArrayList

public IntArrayList(int initialCapacity)
Constructor.
Parameters:
initialCapacity - Initial capacity of the list.
Method Detail

add

public void add(int value)
This method appends an element to the list.
Parameters:
value - The integer value that we assign to the element that we are appending to the list.

ensureCapacity

public void ensureCapacity(int minCapacity)
This method ensures that the list is large enough for minCapacity elements.
Parameters:
minCapacity - The minimum capacity of the list.

ensureCapacityAndFill

public void ensureCapacityAndFill(int minCapacity,
                                  int fillValue)
This method ensures that the list is large enough for minCapacity elements. It also fills in the new slots in the list with the integer value input as fillValue.
Parameters:
minCapacity - The minimum capacity of the list.
fillValue - This method adds in a integer for each slot that was added to ensure that the list meets the minimum capacity. fillValue is the value used as the initial value of these added elements.

get

public int get(int index)
This method gets the integer value stored in element index.
Parameters:
index - The index in the list of the element we wish to get the value from.
Returns:
The value of the data stored in element index.

set

public void set(int index,
                int value)
This method sets an element of the list to the input integer value.
Parameters:
index - The index in the list of the element we wish to set.
value - The integer value that we assign to the selected element of the list.

size

public int size()
This method gets the size of the list.
Returns:
The size of the list.

OpenOffice.org
XMerge API

Copyright © 2002 OpenOffice.org