org.knime.core.data.container
Class BufferFromFileIteratorVersion20

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.BufferFromFileIteratorVersion20
All Implemented Interfaces:
Iterator<DataRow>, KNIMEStreamConstants

final class BufferFromFileIteratorVersion20
extends Buffer.FromFileIterator

File iterator to read stream written by a Buffer.

Author:
Bernd Wiswedel, University of Konstanz

Nested Class Summary
(package private) static class BufferFromFileIteratorVersion20.DataCellStreamReader
          Utility class that separates the logic of reading DataCells from the stream.
 
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
BufferFromFileIteratorVersion20(Buffer buffer)
          Inits iterator, opens 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.
 
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

BufferFromFileIteratorVersion20

BufferFromFileIteratorVersion20(Buffer buffer)
                          throws IOException
Inits iterator, opens input stream.

Parameters:
buffer - The associated buffer.
Throws:
IOException - If stream reading fails.
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


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.