de.lmu.ifi.dbs.elki.result
Class ResultUtil

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.result.ResultUtil

public class ResultUtil
extends Object

Utilities for handling result objects


Constructor Summary
ResultUtil()
           
 
Method Summary
static void addChildResult(HierarchicalResult parent, Result child)
          Add a child result.
static
<O> void
ensureClusteringResult(Database db, Result result)
          Ensure that the result contains at least one Clustering.
static void ensureSelectionResult(Database db, Result result)
          Ensure that there also is a selection container object.
static
<C extends Result>
IterableIterator<C>
filteredResults(Result r, Class<?> restrictionClass)
           
static
<C> ArrayList<C>
filterResults(Result r, Class<?> restrictionClass)
          Return only results of the given restriction class
static Database findDatabase(Result baseResult)
          Find the first database result in the tree.
static List<Clustering<? extends Model>> getClusteringResults(Result r)
          Collect all clustering results from a Result
static List<CollectionResult<?>> getCollectionResults(Result r)
          Collect all collection results from a Result
static List<IterableResult<?>> getIterableResults(Result r)
          Return all Iterable results
static List<OrderingResult> getOrderingResults(Result r)
          Collect all ordering results from a Result
static List<OutlierResult> getOutlierResults(Result r)
          Collect all outlier results from a Result
static List<Relation<?>> getRelations(Result r)
          Collect all Annotation results from a Result
static List<SettingsResult> getSettingsResults(Result r)
          Collect all settings results from a Result
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultUtil

public ResultUtil()
Method Detail

getRelations

public static List<Relation<?>> getRelations(Result r)
Collect all Annotation results from a Result

Parameters:
r - Result
Returns:
List of all annotation results

getOrderingResults

public static List<OrderingResult> getOrderingResults(Result r)
Collect all ordering results from a Result

Parameters:
r - Result
Returns:
List of ordering results

getClusteringResults

public static List<Clustering<? extends Model>> getClusteringResults(Result r)
Collect all clustering results from a Result

Parameters:
r - Result
Returns:
List of clustering results

getCollectionResults

public static List<CollectionResult<?>> getCollectionResults(Result r)
Collect all collection results from a Result

Parameters:
r - Result
Returns:
List of collection results

getIterableResults

public static List<IterableResult<?>> getIterableResults(Result r)
Return all Iterable results

Parameters:
r - Result
Returns:
List of iterable results

getOutlierResults

public static List<OutlierResult> getOutlierResults(Result r)
Collect all outlier results from a Result

Parameters:
r - Result
Returns:
List of outlier results

getSettingsResults

public static List<SettingsResult> getSettingsResults(Result r)
Collect all settings results from a Result

Parameters:
r - Result
Returns:
List of settings results

filterResults

public static <C> ArrayList<C> filterResults(Result r,
                                             Class<?> restrictionClass)
Return only results of the given restriction class

Type Parameters:
C - Class type
Parameters:
restrictionClass - Class restriction
Returns:
filtered results list

filteredResults

public static <C extends Result> IterableIterator<C> filteredResults(Result r,
                                                                     Class<?> restrictionClass)

ensureClusteringResult

public static <O> void ensureClusteringResult(Database db,
                                              Result result)
Ensure that the result contains at least one Clustering.

Type Parameters:
O - Database type
Parameters:
db - Database to process
result - result

ensureSelectionResult

public static void ensureSelectionResult(Database db,
                                         Result result)
Ensure that there also is a selection container object.

Parameters:
db - Database
result - Result

addChildResult

public static void addChildResult(HierarchicalResult parent,
                                  Result child)
Add a child result.

Parameters:
parent - Parent
child - Child

findDatabase

public static Database findDatabase(Result baseResult)
Find the first database result in the tree.

Parameters:
baseResult - Result tree base.
Returns:
Database

Release 0.4.0 (2011-09-20_1324)