Top Description Fields Constructors Methods
org.apache.commons.compress.harmony.pack200

public Class IntList

extends Object
Class Inheritance
Imports
java.util.Arrays

IntList is based on java.util.ArrayList, but is written specifically for ints in order to reduce boxing and unboxing to Integers, reduce the memory required and improve performance of pack200.

Field Summary

Modifier and TypeField and Description
private int[]
private int
private int
private int

Constructor Summary

AccessConstructor and Description
public
IntList()

Constructs a new instance of IntList with capacity for ten elements.

public
IntList(final int
the initial capacity of this IntList
capacity
)

Constructs a new instance of IntList with the specified capacity.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true
add
(final int
the object to add
object
)

Adds the specified object at the end of this IntList.

public void
add(final int location, final int object)

public void
addAll(final IntList list)

public void
public int
get(final int location)

private void
growAtEnd(final int required)

private void
growAtFront(final int required)

private void
growForInsert(final int location, final int required)

public void
increment(final int location)

public boolean
public int
remove(final int location)

public int
size()

public int[]
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

arrayback to summary
private int[] array
firstIndexback to summary
private int firstIndex
lastIndexback to summary
private int lastIndex
modCountback to summary
private int modCount

Constructor Detail

IntListback to summary
public IntList()

Constructs a new instance of IntList with capacity for ten elements.

IntListback to summary
public IntList(final int capacity)

Constructs a new instance of IntList with the specified capacity.

Parameters
capacity:int

the initial capacity of this IntList

Method Detail

addback to summary
public boolean add(final int object)

Adds the specified object at the end of this IntList.

Parameters
object:int

the object to add

Returns:boolean

true

addback to summary
public void add(final int location, final int object)
addAllback to summary
public void addAll(final IntList list)
clearback to summary
public void clear()
getback to summary
public int get(final int location)
growAtEndback to summary
private void growAtEnd(final int required)
growAtFrontback to summary
private void growAtFront(final int required)
growForInsertback to summary
private void growForInsert(final int location, final int required)
incrementback to summary
public void increment(final int location)
isEmptyback to summary
public boolean isEmpty()
removeback to summary
public int remove(final int location)
sizeback to summary
public int size()
toArrayback to summary
public int[] toArray()