org.knime.core.data.container
Class BufferFromFileIteratorVersion1x

java.lang.Object
  extended by org.knime.core.data.RowIterator
      extended by org.knime.core.data.container.CloseableRowIterator
          extended by org.knime.core.data.container.Buffer.FromFileIterator
              extended by org.knime.core.data.container.BufferFromFileIteratorVersion1x
All Implemented Interfaces:
Iterator<DataRow>, KNIMEStreamConstants

final class BufferFromFileIteratorVersion1x
extends Buffer.FromFileIterator

(Obsolete) File iterator to read files written by a Buffer. This class is used for backward compatibility, it reads all stream written with KNIME 1.x or the TechPreview of 2.0.

Author:
Bernd Wiswedel, University of Konstanz

Field Summary
 
Fields inherited from interface org.knime.core.data.container.KNIMEStreamConstants
BYTE_ROW_SEPARATOR, BYTE_TYPE_MISSING, BYTE_TYPE_SERIALIZATION, BYTE_TYPE_START, DUMMY_ROW_KEY, TC_ESCAPE, TC_TERMINATE
 
Constructor Summary
BufferFromFileIteratorVersion1x(Buffer buffer)
          Inits the iterator by opening the input stream.
 
Method Summary
 void close()
          Closes this iterator.
protected  void finalize()
          
 boolean hasNext()
          Returns true if there are more rows and false otherwise.
 BlobSupportDataRow next()
          Returns the next DataRow.
(package private)  boolean performClose()
          Called when the stream closing should take place.
(package private) static BlobDataCell readBlobDataCell(Buffer buffer, BlobDataCell.BlobAddress blobAddress, CellClassInfo cl)
          Reads the blob from the given blob address.
 
Methods inherited from class org.knime.core.data.RowIterator
remove
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferFromFileIteratorVersion1x

BufferFromFileIteratorVersion1x(Buffer buffer)
                          throws IOException
Inits the iterator by opening the input stream.

Parameters:
buffer - Associated buffer.
Throws:
IOException - If stream can't be opened.
Method Detail

hasNext

public boolean hasNext()
Returns true if there are more rows and false otherwise.

Specified by:
hasNext in interface Iterator<DataRow>
Specified by:
hasNext in class RowIterator
Returns:
true if the iterator has more elements, otherwise false
See Also:
RowIterator.next()

next

public BlobSupportDataRow next()
Returns the next DataRow.

Specified by:
next in interface Iterator<DataRow>
Specified by:
next in class Buffer.FromFileIterator
Returns:
the next row in the DataTable

performClose

boolean performClose()
               throws IOException
Called when the stream closing should take place.

Specified by:
performClose in class Buffer.FromFileIterator
Returns:
Whether the stream close was actually performed (that is false when already closed.)
Throws:
IOException - If closing fails.

close

public void close()
Closes this iterator. Subsequent calls of RowIterator.hasNext() will return false. This method does not need to be called if the iterator was pushed to the end (stream will be closed automatically). It's meant to be used in cases where the iterator might not advance to the end of the table.

This method does nothing if the table is already closed (multiple invocations are ignored).

Specified by:
close in class CloseableRowIterator

finalize

protected void finalize()
                 throws Throwable

Overrides:
finalize in class Object
Throws:
Throwable

readBlobDataCell

static BlobDataCell readBlobDataCell(Buffer buffer,
                                     BlobDataCell.BlobAddress blobAddress,
                                     CellClassInfo cl)
                              throws IOException
Reads the blob from the given blob address.

Parameters:
buffer - The owning buffer.
blobAddress - The address to read from.
cl - The expected class.
Returns:
The blob cell being read.
Throws:
IOException - If that fails.


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.