Package moa.tasks.ipynb
Class NotebookCellBuilder
- java.lang.Object
-
- moa.tasks.ipynb.NotebookCellBuilder
-
- Direct Known Subclasses:
CodeCellBuilder
,MarkDownCellBuilder
,RawCellBuilder
public abstract class NotebookCellBuilder extends Object
Abstract class of a cell- Author:
- Truong To (todinhtruong at gmail dot com)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description NotebookCellBuilder
addSource(String line)
Appends a line of source to cell on a new separate line.StringBuilder
build()
Create a cell with the right formatprotected abstract String
cellType()
Gets the cell-type string of this type of cell.protected Map<String,String>
fields()
Defines the fields of this cell and their contents.
-
-
-
Method Detail
-
cellType
protected abstract String cellType()
Gets the cell-type string of this type of cell.- Returns:
- The cell-type string.
-
addSource
public final NotebookCellBuilder addSource(String line)
Appends a line of source to cell on a new separate line.- Parameters:
line
- The line of source to be added.
-
fields
protected Map<String,String> fields()
Defines the fields of this cell and their contents. Does not include the "source" field, as this is handled separately.- Returns:
- A map from field name to field contents.
-
build
public final StringBuilder build()
Create a cell with the right format
-
-