-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
using new DataCell style of KNIME 3.0
- Loading branch information
Showing
5 changed files
with
65 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...knime.knip.cellprofiler/src/org/knime/knip/cellprofiler/data/CellProfilerCellFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.knime.knip.cellprofiler.data; | ||
|
||
import org.knime.core.data.DataCellFactory; | ||
import org.knime.core.data.DataType; | ||
|
||
public class CellProfilerCellFactory implements DataCellFactory { | ||
|
||
@Override | ||
public DataType getDataType() { | ||
return CellProfilerCell.TYPE; | ||
} | ||
|
||
} |
36 changes: 36 additions & 0 deletions
36
...me.knip.cellprofiler/src/org/knime/knip/cellprofiler/data/CellProfilerCellSerializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.knime.knip.cellprofiler.data; | ||
|
||
import java.io.IOException; | ||
|
||
import org.knime.core.data.DataCellDataInput; | ||
import org.knime.core.data.DataCellDataOutput; | ||
import org.knime.core.data.DataCellSerializer; | ||
|
||
public class CellProfilerCellSerializer implements DataCellSerializer<CellProfilerCell> { | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public void serialize(final CellProfilerCell cell, final DataCellDataOutput output) throws IOException { | ||
output.writeInt(0); // version | ||
CellProfilerContent cpc = cell.getCellProfilerContent(); | ||
cpc.save(output); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public CellProfilerCell deserialize(final DataCellDataInput input) throws IOException { | ||
input.readInt(); // version | ||
CellProfilerContent cpc = null; | ||
try { | ||
cpc = CellProfilerContent.load(input); | ||
} catch (ClassNotFoundException e) { | ||
throw new RuntimeException("Class not found"); | ||
} | ||
return new CellProfilerCell(cpc); | ||
} | ||
|
||
} |