org.eclipse.jgit.util
Class IntList
java.lang.Object
org.eclipse.jgit.util.IntList
public class IntList
- extends java.lang.Object
A more efficient List using a primitive integer array.
|
Constructor Summary |
IntList()
Create an empty list with a default capacity. |
IntList(int capacity)
Create an empty list with the specified capacity. |
|
Method Summary |
void |
add(int n)
Add an entry to the end of the list. |
void |
clear()
Empty this list |
void |
fillTo(int toIndex,
int val)
Pad the list with entries. |
int |
get(int i)
|
int |
size()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
IntList
public IntList()
- Create an empty list with a default capacity.
IntList
public IntList(int capacity)
- Create an empty list with the specified capacity.
- Parameters:
capacity - number of entries the list can initially hold.
size
public int size()
- Returns:
- number of entries in this list
get
public int get(int i)
- Parameters:
i - index to read, must be in the range [0, size()).
- Returns:
- the number at the specified index
- Throws:
java.lang.ArrayIndexOutOfBoundsException - the index outside the valid range
clear
public void clear()
- Empty this list
add
public void add(int n)
- Add an entry to the end of the list.
- Parameters:
n - the number to add.
fillTo
public void fillTo(int toIndex,
int val)
- Pad the list with entries.
- Parameters:
toIndex - index position to stop filling at. 0 inserts no filler. 1
ensures the list has a size of 1, adding val if
the list is currently empty.val - value to insert into padded positions.
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object