Package elki.database.ids
Interface ArrayDBIDs
-
- All Superinterfaces:
DBIDs
- All Known Subinterfaces:
ArrayModifiableDBIDs
,ArrayStaticDBIDs
,DBID
,DBIDPair
,DBIDRange
,DBIDVar
,IntegerArrayDBIDs
,IntegerArrayStaticDBIDs
- All Known Implementing Classes:
ArrayModifiableIntegerDBIDs
,ArrayModifiableIntegerDBIDs.Slice
,ArrayStaticIntegerDBIDs
,ArrayStaticIntegerDBIDs.Slice
,EmptyDBIDs
,IntegerDBID
,IntegerDBIDPair
,IntegerDBIDPair.Slice
,IntegerDBIDRange
,IntegerDBIDVar
,UnmodifiableIntegerArrayDBIDs
public interface ArrayDBIDs extends DBIDs
Interface for array based DBIDs.- Since:
- 0.4.0
- Author:
- Erich Schubert
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description DBIDVar
assignVar(int index, DBIDVar var)
Assign a DBID variable the value of positionindex
.int
binarySearch(DBIDRef key)
Search for the position of the given key, assuming that the data set is sorted.DBID
get(int i)
Deprecated.DBIDArrayIter
iter()
Iterableint
size()
Size of the DBID "collection".ArrayDBIDs
slice(int begin, int end)
Slice a subarray (as view, not copy!)
-
-
-
Method Detail
-
get
@Deprecated DBID get(int i)
Deprecated.Get the i'th entry (starting at 0)If possible, use an
DBIDArrayIter
viaiter()
instead, or anDBIDVar
viaassignVar(int, elki.database.ids.DBIDVar)
- Parameters:
i
- Index- Returns:
- DBID of i'th entry.
-
assignVar
DBIDVar assignVar(int index, DBIDVar var)
Assign a DBID variable the value of positionindex
.- Parameters:
index
- Positionvar
- Variable to assign the value to.
-
iter
DBIDArrayIter iter()
Iterable
-
binarySearch
int binarySearch(DBIDRef key)
Search for the position of the given key, assuming that the data set is sorted. For unsorted arrays, the result is undefined.For keys not found,
-(1+insertion position)
is returned, as for JavaCollections.binarySearch(java.util.List<? extends java.lang.Comparable<? super T>>, T)
- Parameters:
key
- Key to search for- Returns:
- Offset of key
-
slice
ArrayDBIDs slice(int begin, int end)
Slice a subarray (as view, not copy!)- Parameters:
begin
- Begin (inclusive)end
- End (exclusive)- Returns:
- Array slice.
-
-