|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.core.data.container.ContainerTable
public final class ContainerTable
Class implementing the DataTable
interface and using a buffer
from a DataContainer
as data source. This class doesn't do
functional things. It only provides the DataTable
methods.
We split it from the Buffer
implementation as a buffer is
dynamic in size. This table should only be used when the buffer has been
fixed.
Constructor Summary | |
---|---|
ContainerTable(Buffer buffer)
Create new Table based on a Buffer. |
|
ContainerTable(CopyOnAccessTask readTask,
DataTableSpec spec)
Constructor when table is read from file. |
Method Summary | |
---|---|
void |
clear()
Do not call this method! It's used internally to delete temp files. |
void |
ensureOpen()
Do not use this method (only invoked by the framework). |
(package private) Buffer |
getBuffer()
Get reference to buffer. |
int |
getBufferID()
Delegates to buffer to get its ID. |
DataTableSpec |
getDataTableSpec()
Returns the DataTableSpec object of this table which gives
information about the structure of this data table. |
BufferedDataTable[] |
getReferenceTables()
Returns an empty array. |
int |
getRowCount()
Row count of the table. |
CloseableRowIterator |
iterator()
Returns a row iterator which returns each row one-by-one from the table. |
void |
putIntoTableRepository(HashMap<Integer,ContainerTable> rep)
Put this table into the global table repository. |
void |
removeFromTableRepository(HashMap<Integer,ContainerTable> rep)
Remove this table from global table repository. |
protected void |
restoreIntoMemory()
Instruct the underlying buffer to cache the rows into main memory to accelerate future iterations. |
void |
saveToFile(File f,
NodeSettingsWO settings,
ExecutionMonitor exec)
Do not call this method! Internal use! Save the table to a file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
ContainerTable(Buffer buffer)
DataContainer.getTable()
.
buffer
- To read data from.DataContainer.getTable()
ContainerTable(CopyOnAccessTask readTask, DataTableSpec spec)
readTask
- Carries out the copy process when iterator is requested
(just once).spec
- The spec of this table.Method Detail |
---|
public DataTableSpec getDataTableSpec()
DataTableSpec
object of this table which gives
information about the structure of this data table.
getDataTableSpec
in interface DataTable
public CloseableRowIterator iterator()
iterator
in interface Iterable<DataRow>
iterator
in interface DataTable
iterator
in interface BufferedDataTable.KnowsRowCountTable
DataRow
public int getRowCount()
getRowCount
in interface BufferedDataTable.KnowsRowCountTable
Buffer getBuffer()
public int getBufferID()
Buffer.getBufferID()
protected void restoreIntoMemory()
Buffer.restoreIntoMemory()
public void saveToFile(File f, NodeSettingsWO settings, ExecutionMonitor exec) throws IOException, CanceledExecutionException
saveToFile
in interface BufferedDataTable.KnowsRowCountTable
f
- To write to.settings
- To add meta information to.exec
- For progress/cancel.
IOException
- If writing fails.
CanceledExecutionException
- If canceled.public void putIntoTableRepository(HashMap<Integer,ContainerTable> rep)
putIntoTableRepository
in interface BufferedDataTable.KnowsRowCountTable
rep
- The workflow table repository.public void removeFromTableRepository(HashMap<Integer,ContainerTable> rep)
removeFromTableRepository
in interface BufferedDataTable.KnowsRowCountTable
rep
- The workflow table repository.public void clear()
clear
in interface BufferedDataTable.KnowsRowCountTable
BufferedDataTable.KnowsRowCountTable.clear()
public void ensureOpen()
BufferedDataTable.ensureOpen()
.
ensureOpen
in interface BufferedDataTable.KnowsRowCountTable
public BufferedDataTable[] getReferenceTables()
getReferenceTables
in interface BufferedDataTable.KnowsRowCountTable
null
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |