T
- Data type in hash mappublic class OrderingFromDataStore<T extends java.lang.Comparable<T>> extends BasicResult implements OrderingResult
Modifier and Type | Field and Description |
---|---|
(package private) int |
ascending
Factor for ascending (+1) and descending (-1) ordering.
|
protected java.util.Comparator<T> |
comparator
Comparator to use when sorting
|
protected DBIDs |
ids
Database IDs
|
protected DataStore<? extends T> |
map
HashMap with object values
|
Constructor and Description |
---|
OrderingFromDataStore(java.lang.String name,
java.lang.String shortname,
DBIDs ids,
DataStore<? extends T> map)
Minimal Constructor
|
OrderingFromDataStore(java.lang.String name,
java.lang.String shortname,
DBIDs ids,
DataStore<? extends T> map,
boolean descending)
Constructor without comparator
|
OrderingFromDataStore(java.lang.String name,
java.lang.String shortname,
DBIDs ids,
DataStore<? extends T> map,
java.util.Comparator<T> comparator,
boolean descending)
Constructor with comparator
|
Modifier and Type | Method and Description |
---|---|
DBIDs |
getDBIDs()
Get the full set of DBIDs this ordering is defined for.
|
ArrayModifiableDBIDs |
order(DBIDs ids)
Sort the given ids according to this ordering and return an iterator.
|
getLongName, getShortName
addChildResult, getHierarchy, setHierarchy
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLongName, getShortName
protected DBIDs ids
protected java.util.Comparator<T extends java.lang.Comparable<T>> comparator
int ascending
public OrderingFromDataStore(java.lang.String name, java.lang.String shortname, DBIDs ids, DataStore<? extends T> map, java.util.Comparator<T> comparator, boolean descending)
name
- The long name (for pretty printing)shortname
- the short name (for filenames etc.)ids
- DBIDs includedmap
- data hash mapcomparator
- comparator to use, may be nulldescending
- ascending (false) or descending (true) order.public OrderingFromDataStore(java.lang.String name, java.lang.String shortname, DBIDs ids, DataStore<? extends T> map, boolean descending)
name
- The long name (for pretty printing)shortname
- the short name (for filenames etc.)ids
- DBIDs includedmap
- data hash mapdescending
- ascending (false) or descending (true) order.public OrderingFromDataStore(java.lang.String name, java.lang.String shortname, DBIDs ids, DataStore<? extends T> map)
name
- The long name (for pretty printing)shortname
- the short name (for filenames etc.)ids
- DBIDs includedmap
- data hash mappublic DBIDs getDBIDs()
OrderingResult
getDBIDs
in interface OrderingResult
public ArrayModifiableDBIDs order(DBIDs ids)
OrderingResult
order
in interface OrderingResult
ids
- Collection of ids.Copyright © 2019 ELKI Development Team. License information.