Package elki.result
Class CollectionResult<O>
- java.lang.Object
-
- elki.result.CollectionResult<O>
-
- Type Parameters:
O- data type
- All Implemented Interfaces:
IterableResult<O>,java.lang.Iterable<O>
- Direct Known Subclasses:
HistogramResult,IndexStatistics.IndexMetaResult,JudgeOutlierScores.ScoreResult,ReferencePointsResult
public class CollectionResult<O> extends java.lang.Object implements IterableResult<O>
Simple 'collection' type of result. For example, a list of NumberVectors.- Since:
- 0.2
- Author:
- Erich Schubert
-
-
Constructor Summary
Constructors Constructor Description CollectionResult(java.util.Collection<O> col)ConstructorCollectionResult(java.util.Collection<O> col, java.util.Collection<java.lang.String> header)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHeader(java.lang.String s)Add header informationjava.util.Collection<java.lang.String>getHeader()Get header informationjava.util.Iterator<O>iterator()Implementation of theIterableResultinterface, using the backing collection.intsize()Get the collection size.
-
-
-
Field Detail
-
col
private java.util.Collection<O> col
The collection represented.
-
header
private java.util.Collection<java.lang.String> header
Meta information (printed into the header)
-
-
Constructor Detail
-
CollectionResult
public CollectionResult(java.util.Collection<O> col, java.util.Collection<java.lang.String> header)
Constructor- Parameters:
col- Collection representedheader- Auxiliary information for result headers
-
CollectionResult
public CollectionResult(java.util.Collection<O> col)
Constructor- Parameters:
col- Collection represented
-
-
Method Detail
-
addHeader
public void addHeader(java.lang.String s)
Add header information- Parameters:
s- Header information string
-
getHeader
public java.util.Collection<java.lang.String> getHeader()
Get header information- Returns:
- header information of the result
-
iterator
public java.util.Iterator<O> iterator()
Implementation of theIterableResultinterface, using the backing collection.- Specified by:
iteratorin interfacejava.lang.Iterable<O>- Specified by:
iteratorin interfaceIterableResult<O>- Returns:
- iterator
-
size
public int size()
Get the collection size.- Returns:
- Collection size
-
-