public class LongList extends Object
Constructor and Description |
---|
LongList()
Create an empty list with a default capacity.
|
LongList(int capacity)
Create an empty list with the specified capacity.
|
Modifier and Type | Method and Description |
---|---|
void |
add(long n)
Add an entry to the end of the list.
|
void |
clear()
Empty this list
|
boolean |
contains(long value)
Determine if an entry appears in this collection.
|
void |
fillTo(int toIndex,
long val)
Pad the list with entries.
|
long |
get(int i) |
void |
set(int index,
long n)
Assign an entry in the list.
|
int |
size() |
void |
sort()
Sort the list of longs according to their natural ordering.
|
String |
toString() |
public LongList()
public LongList(int capacity)
capacity
- number of entries the list can initially hold.public int size()
public long get(int i)
i
- index to read, must be in the range [0, size()
).ArrayIndexOutOfBoundsException
- the index outside the valid rangepublic boolean contains(long value)
value
- the value to search for.value
appears in this list.public void clear()
public void add(long n)
n
- the number to add.public void set(int index, long n)
index
- index to set, must be in the range [0, size()
).n
- value to store at the position.public void fillTo(int toIndex, long val)
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.public void sort()
Copyright © 2015 Eclipse JGit Project. All rights reserved.