T
- Data type in hash mappublic class OrderingFromDataStore<T extends Comparable<T>> extends BasicResult implements OrderingResult
Modifier and Type | Class and Description |
---|---|
protected class |
OrderingFromDataStore.DerivedComparator
Internal comparator, accessing the map but then using the provided
comparator to sort objects
|
protected class |
OrderingFromDataStore.ImpliedComparator
Internal comparator, accessing the map to sort objects
|
Modifier and Type | Field and Description |
---|---|
(package private) int |
ascending
Factor for ascending (+1) and descending (-1) ordering.
|
protected 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(String name,
String shortname,
DBIDs ids,
DataStore<? extends T> map)
Minimal Constructor
|
OrderingFromDataStore(String name,
String shortname,
DBIDs ids,
DataStore<? extends T> map,
boolean descending)
Constructor without comparator
|
OrderingFromDataStore(String name,
String shortname,
DBIDs ids,
DataStore<? extends T> map,
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 |
iter(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 DataStore<? extends T extends Comparable<T>> map
protected DBIDs ids
protected Comparator<T extends Comparable<T>> comparator
int ascending
public OrderingFromDataStore(String name, String shortname, DBIDs ids, DataStore<? extends T> map, 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(String name, 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 DBIDs getDBIDs()
OrderingResult
getDBIDs
in interface OrderingResult
public ArrayModifiableDBIDs iter(DBIDs ids)
OrderingResult
iter
in interface OrderingResult
ids
- Collection of ids.