Constructor and Description |
---|
Builder()
Create an empty list ready for items to be added.
|
Builder(int capacity)
Create an empty list with at least the specified capacity.
|
Modifier and Type | Method and Description |
---|---|
void |
add(T ref)
Add the reference to the end of the array.
|
void |
addAll(Ref[] src,
int off,
int cnt)
Add all items from a source array.
|
T |
get(int idx)
Get the reference at a particular index.
|
void |
remove(int idx)
Remove an item at a specific index.
|
void |
set(int idx,
T ref)
Replace a single existing element.
|
int |
size() |
void |
sort()
Sort the list's backing array in-place.
|
RefList<T> |
toRefList() |
String |
toString() |
public Builder()
public Builder(int capacity)
capacity
- the new capacity; if zero or negative, behavior is the same as
#Builder()
.public int size()
public T get(int idx)
idx
- the index to obtain. Must be 0 <= idx < size()
.public void remove(int idx)
idx
- position to remove the item from.public void add(T ref)
References must be added in sort order, or the array must be sorted
after additions are complete using sort()
.
ref
- public void addAll(Ref[] src, int off, int cnt)
References must be added in sort order, or the array must be sorted
after additions are complete using sort()
.
src
- the source array.off
- position within src
to start copying from.cnt
- number of items to copy from src
.public void set(int idx, T ref)
idx
- index, must have already been added previously.ref
- the new reference.public void sort()
public RefList<T> toRefList()
Copyright © 2019 Eclipse JGit Project. All rights reserved.