Palm API
Beta 2

com.sun.kjava
Class IntVector

java.lang.Object
  |
  +--com.sun.kjava.IntVector

public class IntVector
extends java.lang.Object

A simple expandable vector of integers, similar to java.util.Vector.


Constructor Summary
IntVector()
          Create a new IntVector, and make it small to start.
IntVector(int initSize)
          Create a new IntVector.
 
Method Summary
 void append(int i)
          Append an integer to the end, expanding the vector if necessary.
 int capacity()
          What is the total capacity of this IntVector?
 void ensureCapacity(int newCap)
          Ensure there's room for some number of entries by any means necessary.
 void removeAllElements()
          Mark the vector as containing no integers.
 int size()
          What is the size of this IntVector?
 int valueAt(int i)
          What is the value at a given index? N.B.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntVector

public IntVector()
Create a new IntVector, and make it small to start.

IntVector

public IntVector(int initSize)
Create a new IntVector.
Parameters:
initSize - the number of initial elements to allocate
Method Detail

valueAt

public int valueAt(int i)
What is the value at a given index? N.B. This does no bounds checking.
Parameters:
i - the index of the entry
Returns:
the integer at that index.

size

public int size()
What is the size of this IntVector?
Returns:
the number of integers stored

append

public void append(int i)
Append an integer to the end, expanding the vector if necessary.
Parameters:
i - the value of the new datum

removeAllElements

public void removeAllElements()
Mark the vector as containing no integers.

capacity

public int capacity()
What is the total capacity of this IntVector?
Returns:
the number of entries currently allocated space, not all of which may be occupied.
See Also:
size()

ensureCapacity

public void ensureCapacity(int newCap)
Ensure there's room for some number of entries by any means necessary.
Parameters:
newCap - the desired new capacity

Submit a bug or feature

The GUI classes provided with this release are NOT part of CLDC, and they will be removed in later releases of this software. Official GUI classes for Java 2 Micro Edition will be defined separately through the Java Community Process and included in J2ME profiles. Java is trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2000 Sun Microsystems, Inc.
901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
All Rights Reserved.