Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.result
Class CollectionResult<O>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.result.CollectionResult<O>
Type Parameters:
O - data type
All Implemented Interfaces:
IterableResult<O>, Result, Iterable<O>
Direct Known Subclasses:
HistogramResult, ReferencePointsResult

public class CollectionResult<O>
extends Object
implements IterableResult<O>

Simple 'collection' type of result. For example, a list of NumberVectors.

Author:
Erich Schubert

Field Summary
private  Collection<O> col
          The collection represented.
private  Collection<String> header
          Meta information (printed into the header)
 
Constructor Summary
CollectionResult(Collection<O> col)
          Constructor
CollectionResult(Collection<O> col, Collection<String> header)
          Constructor
 
Method Summary
 void addHeader(String s)
          Add header information
 Collection<String> getHeader()
          Get header information
 String getName()
          Get a user-understandable name for this result.
 Iterator<O> iterator()
          Implementation of the IterableResult interface, using the backing collection.
 int size()
          Get the collection size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

col

private Collection<O> col
The collection represented.


header

private Collection<String> header
Meta information (printed into the header)

Constructor Detail

CollectionResult

public CollectionResult(Collection<O> col,
                        Collection<String> header)
Constructor

Parameters:
col - Collection represented
header - Auxiliary information for result headers

CollectionResult

public CollectionResult(Collection<O> col)
Constructor

Parameters:
col - Collection represented
Method Detail

addHeader

public void addHeader(String s)
Add header information

Parameters:
s - Header information string

getHeader

public Collection<String> getHeader()
Get header information

Returns:
header information of the result

iterator

public Iterator<O> iterator()
Implementation of the IterableResult interface, using the backing collection.

Specified by:
iterator in interface IterableResult<O>
Specified by:
iterator in interface Iterable<O>
Returns:
iterator

size

public int size()
Get the collection size.

Returns:
Collection size

getName

public String getName()
Description copied from interface: Result
Get a user-understandable name for this result. Defaults may be returned such as "list" for a list result.

Specified by:
getName in interface Result
Returns:
result name

Release 0.3 (2010-03-31_1612)