Package elki.result
Class ResultUtil
- java.lang.Object
-
- elki.result.ResultUtil
-
public final class ResultUtil extends java.lang.Object
Utilities for handling result objects- Since:
- 0.2
- Author:
- Erich Schubert
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ResultUtil()
Private constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addChildResult(java.lang.Object parent, java.lang.Object child)
Add a child result.static <C> java.util.ArrayList<C>
filterResults(java.lang.Object r, java.lang.Class<? super C> restrictionClass)
Return only results of the given restriction classstatic Database
findDatabase(java.lang.Object result)
Find the first database result in the tree.static java.util.List<CollectionResult<?>>
getCollectionResults(java.lang.Object r)
Collect all collection results from a Resultstatic java.util.List<IterableResult<?>>
getIterableResults(java.lang.Object r)
Return all Iterable resultsstatic java.util.List<OrderingResult>
getOrderingResults(java.lang.Object r)
Collect all ordering results from a Resultstatic java.util.List<Relation<?>>
getRelations(java.lang.Object r)
Collect all Annotation results from a Resultstatic void
removeRecursive(java.lang.Object child)
Recursively remove a result and its children.
-
-
-
Method Detail
-
getRelations
public static java.util.List<Relation<?>> getRelations(java.lang.Object r)
Collect all Annotation results from a Result- Parameters:
r
- Result- Returns:
- List of all annotation results
-
getOrderingResults
public static java.util.List<OrderingResult> getOrderingResults(java.lang.Object r)
Collect all ordering results from a Result- Parameters:
r
- Result- Returns:
- List of ordering results
-
getCollectionResults
public static java.util.List<CollectionResult<?>> getCollectionResults(java.lang.Object r)
Collect all collection results from a Result- Parameters:
r
- Result- Returns:
- List of collection results
-
getIterableResults
public static java.util.List<IterableResult<?>> getIterableResults(java.lang.Object r)
Return all Iterable results- Parameters:
r
- Result- Returns:
- List of iterable results
-
filterResults
public static <C> java.util.ArrayList<C> filterResults(java.lang.Object r, java.lang.Class<? super C> restrictionClass)
Return only results of the given restriction class- Type Parameters:
C
- Class type- Parameters:
r
- Starting positionrestrictionClass
- Class restriction- Returns:
- filtered results list
-
addChildResult
public static void addChildResult(java.lang.Object parent, java.lang.Object child)
Add a child result.- Parameters:
parent
- Parentchild
- Child
-
findDatabase
public static Database findDatabase(java.lang.Object result)
Find the first database result in the tree.- Parameters:
result
- Result hierarchy.- Returns:
- Database
-
removeRecursive
public static void removeRecursive(java.lang.Object child)
Recursively remove a result and its children.- Parameters:
child
- Result to remove
-
-