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 DBIDVarassignVar(int index, DBIDVar var)Assign a DBID variable the value of positionindex.intbinarySearch(DBIDRef key)Search for the position of the given key, assuming that the data set is sorted.DBIDget(int i)Deprecated.DBIDArrayIteriter()Iterableintsize()Size of the DBID "collection".ArrayDBIDsslice(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
DBIDArrayIterviaiter()instead, or anDBIDVarviaassignVar(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.
-
-