Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

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

Author:
Erich Schubert

Constructor Summary
ResultUtil()
           
 
Method Summary
static MultiResult ensureMultiResult(Result result)
          Ensure the result is a MultiResult, otherwise wrap it in one.
static
<C> List<C>
filterResults(Result r, Class<?> restrictionClass)
          Filter results
static
<T> AnnotationResult<T>
findAnnotationResult(List<AnnotationResult<?>> anns, AssociationID<T> assoc)
          (Try to) find an association of the given ID in the result.
static
<T> AnnotationResult<T>
findAnnotationResult(Result result, AssociationID<T> assoc)
          (Try to) find an association of the given ID in the result.
static List<AnnotationResult<?>> getAnnotationResults(Result r)
          Collect all Annotation results from a Result
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
<M> M
getGlobalAssociation(Result result, AssociationID<M> meta)
          Get first Association from a MultiResult.
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<SettingsResult> getSettingsResults(Result r)
          Collect all settings results from a Result
static
<M> void
setGlobalAssociation(MultiResult result, AssociationID<M> meta, M value)
          Deprecated. 
 
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

setGlobalAssociation

@Deprecated
public static final <M> void setGlobalAssociation(MultiResult result,
                                                             AssociationID<M> meta,
                                                             M value)
Deprecated. 

Set global meta association.

Type Parameters:
M - restriction class
Parameters:
result - Result collection
meta - Association
value - Value

getGlobalAssociation

public static final <M> M getGlobalAssociation(Result result,
                                               AssociationID<M> meta)
Get first Association from a MultiResult.

Type Parameters:
M - restriction class
Parameters:
result - Result collection
meta - Association
Returns:
first match or null

findAnnotationResult

public static final <T> AnnotationResult<T> findAnnotationResult(Result result,
                                                                 AssociationID<T> assoc)
(Try to) find an association of the given ID in the result.

Type Parameters:
T - Association result type
Parameters:
result - Result to find associations in
assoc - Association
Returns:
First matching annotation result or null

findAnnotationResult

public static final <T> AnnotationResult<T> findAnnotationResult(List<AnnotationResult<?>> anns,
                                                                 AssociationID<T> assoc)
(Try to) find an association of the given ID in the result.

Type Parameters:
T - Association result type
Parameters:
anns - List of Results
assoc - Association
Returns:
First matching annotation result or null

getAnnotationResults

public static List<AnnotationResult<?>> getAnnotationResults(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> List<C> filterResults(Result r,
                                        Class<?> restrictionClass)
Filter results

Type Parameters:
C - Class type
Parameters:
r - Result
restrictionClass - Restriction
Returns:
List of filtered results

ensureMultiResult

public static MultiResult ensureMultiResult(Result result)
Ensure the result is a MultiResult, otherwise wrap it in one.

Parameters:
result - Original result
Returns:
MultiResult, either result itself or a MultiResult containing result.

Release 0.3 (2010-03-31_1612)