|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jgit.util.RefList.Builder<T>
T
- type of reference being stored.public static class RefList.Builder<T extends Ref>
Builder to facilitate fast construction of an immutable RefList.
Constructor Summary | |
---|---|
RefList.Builder()
Create an empty list ready for items to be added. |
|
RefList.Builder(int capacity)
Create an empty list with at least the specified capacity. |
Method Summary | |
---|---|
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()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RefList.Builder()
public RefList.Builder(int capacity)
capacity
- the new capacity.Method Detail |
---|
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()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |