java.lang.Object
kala.compress.harmony.pack200.IntList
IntList is based on
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
FieldsModifier and TypeFieldDescriptionprivate int[]private intprivate intprivate int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(int object) Adds the specified object at the end of this IntList.voidadd(int location, int object) voidvoidclear()intget(int location) private voidgrowAtEnd(int required) private voidgrowAtFront(int required) private voidgrowForInsert(int location, int required) voidincrement(int location) booleanisEmpty()intremove(int location) intsize()int[]toArray()
-
Field Details
-
array
private int[] array -
firstIndex
private int firstIndex -
lastIndex
private int lastIndex -
modCount
private int modCount
-
-
Constructor Details
-
IntList
public IntList()Constructs a new instance of IntList with capacity for ten elements. -
IntList
public IntList(int capacity) Constructs a new instance of IntList with the specified capacity.- Parameters:
capacity- the initial capacity of this IntList
-
-
Method Details
-
add
public boolean add(int object) Adds the specified object at the end of this IntList.- Parameters:
object- the object to add- Returns:
- true
-
add
public void add(int location, int object) -
addAll
-
clear
public void clear() -
get
public int get(int location) -
growAtEnd
private void growAtEnd(int required) -
growAtFront
private void growAtFront(int required) -
growForInsert
private void growForInsert(int location, int required) -
increment
public void increment(int location) -
isEmpty
public boolean isEmpty() -
remove
public int remove(int location) -
size
public int size() -
toArray
public int[] toArray()
-