org.knime.core.data.collection
Class SetCell

java.lang.Object
  extended by org.knime.core.data.DataCell
      extended by org.knime.core.data.collection.SetCell
All Implemented Interfaces:
Serializable, Iterable<DataCell>, CollectionDataValue, SetDataValue, DataValue

public class SetCell
extends DataCell
implements SetDataValue

Default implementation of a CollectionDataValue, whereas the underlying data structure is a set (i.e. there won't be duplicates stored in the collection).

Author:
ohl, University of Konstanz
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.knime.core.data.collection.CollectionDataValue
CollectionDataValue.CollectionUtilityFactory
 
Nested classes/interfaces inherited from interface org.knime.core.data.DataValue
DataValue.UtilityFactory
 
Field Summary
 
Fields inherited from interface org.knime.core.data.collection.CollectionDataValue
UTILITY
 
Constructor Summary
protected SetCell(BlobSupportDataCellSet cellSet)
          Rather use one of the factory methods.
 
Method Summary
 boolean contains(DataCell cell)
          Returns true if the collection contains the specified cell.
 boolean containsBlobWrapperCells()
          Get whether the collection contains special BlobWrapperDataCell (framework use).
protected  boolean equalsDataCell(DataCell dc)
          Derived classes implement their specific equals function here.
static DataCellSerializer<SetCell> getCellSerializer()
          Get serializer as required by DataCell.
static DataType getCollectionType(DataType elementType)
          Convenience method to determine the type of collection.
 DataType getElementType()
          Get the common super type of all elements in this collection.
protected  BlobSupportDataCellSet getSet()
           
 int hashCode()
          This method must be implemented in order to ensure that two equal DataCell objects return the same hash code.
 Iterator<DataCell> iterator()
          
 int size()
          Get the number of elements in this collection.
 String toString()
          Returns the String representation of this cell's value.
 
Methods inherited from class org.knime.core.data.DataCell
equals, getType, isMissing
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SetCell

protected SetCell(BlobSupportDataCellSet cellSet)
Rather use one of the factory methods.

Parameters:
cellSet - the set that will be taken over.
See Also:
CollectionCellFactory.createSetCell(Collection), CollectionCellFactory.createSetCell(DataRow, int[])
Method Detail

getCollectionType

public static final DataType getCollectionType(DataType elementType)
Convenience method to determine the type of collection. This is a shortcut for DataType.getType(SetCell.class, elementType).

Parameters:
elementType - The type of the elements
Returns:
a DataType representing the collection.

getCellSerializer

public static final DataCellSerializer<SetCell> getCellSerializer()
Get serializer as required by DataCell.

Returns:
the serializer.

containsBlobWrapperCells

public boolean containsBlobWrapperCells()
Get whether the collection contains special BlobWrapperDataCell (framework use). This method gives a hint to the framwork (specifically to the classes DataContainer and BufferedDataContainer) whether they should handle the cell implementing this interface with care with respect to contained BlobDataCell.

This method should return true only if

Implementation note: This method is really only a helper for the framework. The same information can be retrieved by accessing the iterator. This can be an expensive and unnecessary operation, however.

Specified by:
containsBlobWrapperCells in interface CollectionDataValue
Returns:
Whether the collection contains blob wrapper cells.

equalsDataCell

protected boolean equalsDataCell(DataCell dc)
Derived classes implement their specific equals function here. The argument is guaranteed to be not null or a missing value, to be of the same class like this.

Specified by:
equalsDataCell in class DataCell
Parameters:
dc - the cell to compare this to
Returns:
true if this is equal to the argument, false if not

getElementType

public DataType getElementType()
Get the common super type of all elements in this collection.

Specified by:
getElementType in interface CollectionDataValue
Returns:
The common super type, never null.

hashCode

public int hashCode()
This method must be implemented in order to ensure that two equal DataCell objects return the same hash code.

Specified by:
hashCode in class DataCell
Returns:
the hash code of your specific DataCell
See Also:
Object.hashCode(), DataCell.equals(java.lang.Object)

iterator

public Iterator<DataCell> iterator()

Specified by:
iterator in interface Iterable<DataCell>
Specified by:
iterator in interface CollectionDataValue

contains

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

Specified by:
contains in interface SetDataValue
Parameters:
cell - the cell to check for
Returns:
true if the argument is contained in the collection.
See Also:
DataCell.equals(Object o)

size

public int size()
Get the number of elements in this collection.

Specified by:
size in interface CollectionDataValue
Returns:
size of the collection.

toString

public String toString()
Returns the String representation of this cell's value.

Specified by:
toString in class DataCell
Returns:
a String representation of this cell's value

getSet

protected BlobSupportDataCellSet getSet()
Returns:
the set


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.