Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.caucho.util
Class IntArray

    java.lang.Object
      |
      +--com.caucho.util.IntArray

public class IntArray
extends java.lang.Object

The IntArray is a variable array containing integers. The API follows the JDK 1.2 collection classes.

Constructor Summary
`IntArray()` Create an empty int array.

Method Summary
`void` | `add(int i)` Adds an integer to the array.
`void` | `add(IntArray array)` Appends the integers in array to the end of this array.
`void` | `add(int i, int value)` Inserts an integer into the array.
`void` | `clear()` clear the array, i.e.
`boolean` | `contains(int test)` Returns true if the array contains and integer equal to test.
`int` | `get(int i)` Gets the integer value at the given index.
`boolean` | `isSubset(IntArray subset)` True if all the integers in subset are contained in the array.
`int` | `last()` Returns the last integer in the array.
`int` | `pop()` Pops the value off the end of the array.
`void` | `set(int i, int value)` Sets the value at the given index.
`void` | `setLength(int size)` Sets the length of the array, filling with zero if necessary.
`int` | `size()` Returns the current size of the array
`int[]` | `toArray()` Return a new int array with the contents.
`void` | `union(IntArray newArray)` Adds the members of newArray to the list if they are not already members of the array.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### IntArray

    public IntArray()

  Create an empty int array.

Method Detail

### clear

    public void clear()

  clear the array, i.e. set the size to 0.

### size

    public int size()

  Returns the current size of the array

### add

    public void add(int i)

  Adds an integer to the array.

### add

    public void add(IntArray array)

  Appends the integers in array to the end of this array.

### add

    public void add(int i,
                    int value)

  Inserts an integer into the array.

### pop

    public int pop()

  Pops the value off the end of the array.

### setLength

    public void setLength(int size)

  Sets the length of the array, filling with zero if necessary.

### get

    public int get(int i)

  Gets the integer value at the given index.
  Parameters:
    `i` - index into the array.
  Returns:
    value at the index

### last

    public int last()

  Returns the last integer in the array.

### set

    public void set(int i,
                    int value)

  Sets the value at the given index.

### contains

    public boolean contains(int test)

  Returns true if the array contains and integer equal to test.

### isSubset

    public boolean isSubset(IntArray subset)

  True if all the integers in subset are contained in the array.

### union

    public void union(IntArray newArray)

  Adds the members of newArray to the list if they are not already members of the array.

### toArray

    public int[] toArray()

  Return a new int array with the contents.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD