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
<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<?>> getClusteringResults(Result r)
          Collect all clustering 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<MetadataResult> getMetadataResults(Result r)
          Return all Metadata results
static List<OrderingResult> getOrderingResults(Result r)
          Collect all ordering results from a Result
static
<M> void
setGlobalAssociation(MultiResult result, AssociationID<M> meta, M value)
          Set global meta association.
 
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

public static final <M> void setGlobalAssociation(MultiResult result,
                                                  AssociationID<M> meta,
                                                  M value)
Set global meta association. It tries to replace an existing Association first, then tries to insert in the first MetadataResult otherwise creating a new MetadataResult if none was found.

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<?>> getClusteringResults(Result r)
Collect all clustering results from a Result

Parameters:
r - Result
Returns:
List of clustering results

getIterableResults

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

Parameters:
r - Result
Returns:
List of iterable results

getMetadataResults

public static List<MetadataResult> getMetadataResults(Result r)
Return all Metadata results

Parameters:
r - Result
Returns:
List of metadata results

Release 0.2.1 (2009-07-13_1605)