org.knime.core.data.collection
Class BlobSupportDataCellSet

java.lang.Object
  extended by org.knime.core.data.collection.BlobSupportDataCellSet
All Implemented Interfaces:
Iterable<DataCell>

public class BlobSupportDataCellSet
extends Object
implements Iterable<DataCell>

Author:
ohl, University of Konstanz

Constructor Summary
BlobSupportDataCellSet(Collection<? extends DataCell> cells)
          Rather use one of the factory methods to create a new set.
 
Method Summary
 boolean contains(DataCell cell)
          Returns true if the set contains the specified cell.
 boolean containsBlobWrapperCells()
           
static BlobSupportDataCellSet create(Collection<? extends DataCell> coll)
          Factory method to create a set of data cells based on a collection.
static BlobSupportDataCellSet create(DataRow row, int[] cols)
          Create new set containing selected cells from a DataRow.
static BlobSupportDataCellSet deserialize(DataCellDataInput input)
          Static deserializer for a datacell set.
 boolean equals(Object obj)
          
 DataType getElementType()
           
 int hashCode()
          
 Iterator<DataCell> iterator()
          
 void serialize(DataCellDataOutput output)
          Write this object to an output.
 int size()
          Returns the number of currently stored elements.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BlobSupportDataCellSet

BlobSupportDataCellSet(Collection<? extends DataCell> cells)
Rather use one of the factory methods to create a new set.

Parameters:
cells - to be stored in the new set.
Method Detail

create

public static BlobSupportDataCellSet create(Collection<? extends DataCell> coll)
Factory method to create a set of data cells based on a collection.

If the underlying collection stems from a DataRow (as read from a any table), consider using create(DataRow, int[]) in order to minimize cell access.

Parameters:
coll - The underlying collection to take the cells from .
Returns:
The newly created set.
Throws:
NullPointerException - If the argument is null or contains null elements.

create

public static BlobSupportDataCellSet create(DataRow row,
                                            int[] cols)
Create new set containing selected cells from a DataRow. Using this method will check if the row is returned by a BufferedDataTable and will handle blobs appropriately.

Parameters:
row - The underlying row
cols - The indices of the cells to store in the set
Returns:
A newly created set.
Throws:
NullPointerException - If either argument is null.
IndexOutOfBoundsException - If the indices are invalid.

contains

public boolean contains(DataCell cell)
Returns true if the set contains the specified cell.

Parameters:
cell - the cell to check for
Returns:
true if the set contains the specified cell.

iterator

public Iterator<DataCell> iterator()

Specified by:
iterator in interface Iterable<DataCell>

containsBlobWrapperCells

public boolean containsBlobWrapperCells()
Returns:
true, if at least one of the stored cells is a blob cell

getElementType

public DataType getElementType()
Returns:
the elements' common super type

size

public int size()
Returns the number of currently stored elements. If the set contains more cells than Integer.MAX_VALUE, it returns Integer.MAX_VALUE (see Set.size().

Returns:
the number of currently stored elements

serialize

public void serialize(DataCellDataOutput output)
               throws IOException
Write this object to an output.

Parameters:
output - To write to.
Throws:
IOException - If that fails.

deserialize

public static BlobSupportDataCellSet deserialize(DataCellDataInput input)
                                          throws IOException
Static deserializer for a datacell set.

Parameters:
input - To read from.
Returns:
A newly created set.
Throws:
IOException - If that fails
See Also:
DataCellSerializer.deserialize(DataCellDataInput)

toString

public String toString()

Overrides:
toString in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)

Overrides:
equals in class Object


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.