class TroveArrayModifiableDBIDs extends TroveArrayDBIDs implements ArrayModifiableDBIDs
TroveArrayDBIDs.DBIDItr
Modifier and Type | Field and Description |
---|---|
private gnu.trove.list.array.TIntArrayList |
store
The actual trove array list
|
Modifier | Constructor and Description |
---|---|
protected |
TroveArrayModifiableDBIDs()
Constructor.
|
protected |
TroveArrayModifiableDBIDs(DBIDs existing)
Constructor.
|
protected |
TroveArrayModifiableDBIDs(int size)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(DBIDRef e)
Add a single DBID to the collection.
|
boolean |
addDBIDs(DBIDs ids)
Add DBIDs to collection.
|
void |
clear()
Clear this collection.
|
protected gnu.trove.list.array.TIntArrayList |
getStore()
Get the array store.
|
boolean |
remove(DBIDRef o)
Remove a single DBID from the collection.
|
DBID |
remove(int index)
Remove the i'th entry (starting at 0)
|
boolean |
removeDBIDs(DBIDs ids)
Remove DBIDs from collection.
|
DBID |
set(int index,
DBIDRef element)
Replace the i'th entry (starting at 0)
|
void |
sort()
Sort the DBID set.
|
void |
sort(Comparator<? super DBIDRef> comparator)
Sort the DBID set.
|
void |
sort(int start,
int end,
Comparator<? super DBIDRef> comparator)
Sort the DBID set.
|
void |
swap(int a,
int b)
Swap DBIDs add positions a and b.
|
assign, binarySearch, contains, get, isEmpty, iter, size, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
iter
assign, binarySearch, get, size
protected TroveArrayModifiableDBIDs(int size)
size
- Initial sizeprotected TroveArrayModifiableDBIDs()
protected TroveArrayModifiableDBIDs(DBIDs existing)
existing
- Existing idsprotected gnu.trove.list.array.TIntArrayList getStore()
TroveArrayDBIDs
getStore
in class TroveArrayDBIDs
public boolean addDBIDs(DBIDs ids)
ModifiableDBIDs
addDBIDs
in interface ModifiableDBIDs
ids
- IDs to add.true
when modifiedpublic boolean removeDBIDs(DBIDs ids)
ModifiableDBIDs
removeDBIDs
in interface ModifiableDBIDs
ids
- IDs to remove.true
when modifiedpublic boolean add(DBIDRef e)
ModifiableDBIDs
add
in interface ModifiableDBIDs
e
- ID to addpublic boolean remove(DBIDRef o)
ModifiableDBIDs
remove
in interface ModifiableDBIDs
o
- ID to removepublic DBID set(int index, DBIDRef element)
ArrayModifiableDBIDs
set
in interface ArrayModifiableDBIDs
index
- Indexelement
- New valuepublic DBID remove(int index)
ArrayModifiableDBIDs
remove
in interface ArrayModifiableDBIDs
index
- Indexpublic void clear()
ModifiableDBIDs
clear
in interface ModifiableDBIDs
public void sort()
ArrayModifiableDBIDs
sort
in interface ArrayModifiableDBIDs
public void sort(Comparator<? super DBIDRef> comparator)
ArrayModifiableDBIDs
sort
in interface ArrayModifiableDBIDs
comparator
- Comparator to usepublic void sort(int start, int end, Comparator<? super DBIDRef> comparator)
ArrayModifiableDBIDs
sort
in interface ArrayModifiableDBIDs
start
- Starting index, for partial sortingend
- End index, for partial sorting (exclusive)comparator
- Comparator to usepublic void swap(int a, int b)
ArrayModifiableDBIDs
swap
in interface ArrayModifiableDBIDs
a
- First positionb
- Second position