Package org.rcsb.cif.model.builder
Class CategoryBuilderImpl<P extends BlockBuilder<PP>,PP extends CifFileBuilder>
java.lang.Object
org.rcsb.cif.model.builder.CategoryBuilderImpl<P,PP>
- All Implemented Interfaces:
CategoryBuilder<P,PP>
- Direct Known Subclasses:
CifCoreCategoryBuilder,MmCifCategoryBuilder
public class CategoryBuilderImpl<P extends BlockBuilder<PP>,PP extends CifFileBuilder> extends Object implements CategoryBuilder<P,PP>
-
Field Summary
-
Constructor Summary
Constructors Constructor Description CategoryBuilderImpl(String categoryName, P parent) -
Method Summary
Modifier and Type Method Description CategoryBuilder<P,PP>addColumn(Column<?> column)Add a column to this builder.Categorybuild()Build this category as a detached instance.voiddigest(FloatColumnBuilder<? extends CategoryBuilder<P,PP>,P,PP> columnBuilder)A hook to make this instance aware of the data in all child nodes.voiddigest(IntColumnBuilder<? extends CategoryBuilder<P,PP>,P,PP> columnBuilder)A hook to make this instance aware of the data in all child nodes.voiddigest(StrColumnBuilder<? extends CategoryBuilder<P,PP>,P,PP> columnBuilder)A hook to make this instance aware of the data in all child nodes.FloatColumnBuilder<CategoryBuilder<P,PP>,P,PP>enterFloatColumn(String columnName)Descend 1 level and enter a new FloatColumn.IntColumnBuilder<CategoryBuilder<P,PP>,P,PP>enterIntColumn(String columnName)Descend 1 level and enter a new IntColumn.StrColumnBuilder<CategoryBuilder<P,PP>,P,PP>enterStrColumn(String columnName)Descend 1 level and enter a new StrColumn.StringgetCategoryName()The name of this category.Map<String,Column<?>>getColumns()The column map of this builder (and Category about to be created).PleaveCategory()Leave this category and move back to the parent builder at Block level.voidregisterChild(ColumnBuilder<? extends CategoryBuilder<P,PP>,P,PP> builder)Make this builder aware of a child builder at column level.
-
Field Details
-
Constructor Details
-
Method Details
-
getCategoryName
Description copied from interface:CategoryBuilderThe name of this category.- Specified by:
getCategoryNamein interfaceCategoryBuilder<P extends BlockBuilder<PP>,PP extends CifFileBuilder>- Returns:
- a String
-
getColumns
Description copied from interface:CategoryBuilderThe column map of this builder (and Category about to be created).- Specified by:
getColumnsin interfaceCategoryBuilder<P extends BlockBuilder<PP>,PP extends CifFileBuilder>- Returns:
- a map with column names as keys and Column instances as values
-
leaveCategory
Description copied from interface:CategoryBuilderLeave this category and move back to the parent builder at Block level.- Specified by:
leaveCategoryin interfaceCategoryBuilder<P extends BlockBuilder<PP>,PP extends CifFileBuilder>- Returns:
- the parent builder
-
build
Description copied from interface:CategoryBuilderBuild this category as a detached instance.- Specified by:
buildin interfaceCategoryBuilder<P extends BlockBuilder<PP>,PP extends CifFileBuilder>- Returns:
- the Category described by this builder
-
addColumn
Description copied from interface:CategoryBuilderAdd a column to this builder.- Specified by:
addColumnin interfaceCategoryBuilder<P extends BlockBuilder<PP>,PP extends CifFileBuilder>- Parameters:
column- some column with data- Returns:
- this builder instance
-
digest
Description copied from interface:CategoryBuilderA hook to make this instance aware of the data in all child nodes.- Specified by:
digestin interfaceCategoryBuilder<P extends BlockBuilder<PP>,PP extends CifFileBuilder>- Parameters:
columnBuilder- the child builder to digest
-
digest
Description copied from interface:CategoryBuilderA hook to make this instance aware of the data in all child nodes.- Specified by:
digestin interfaceCategoryBuilder<P extends BlockBuilder<PP>,PP extends CifFileBuilder>- Parameters:
columnBuilder- the child builder to digest
-
digest
Description copied from interface:CategoryBuilderA hook to make this instance aware of the data in all child nodes.- Specified by:
digestin interfaceCategoryBuilder<P extends BlockBuilder<PP>,PP extends CifFileBuilder>- Parameters:
columnBuilder- the child builder to digest
-
enterIntColumn
Description copied from interface:CategoryBuilderDescend 1 level and enter a new IntColumn.- Specified by:
enterIntColumnin interfaceCategoryBuilder<P extends BlockBuilder<PP>,PP extends CifFileBuilder>- Parameters:
columnName- the name for this column- Returns:
- a parent-aware builder instance at column level
-
enterFloatColumn
Description copied from interface:CategoryBuilderDescend 1 level and enter a new FloatColumn.- Specified by:
enterFloatColumnin interfaceCategoryBuilder<P extends BlockBuilder<PP>,PP extends CifFileBuilder>- Parameters:
columnName- the name for this column- Returns:
- a parent-aware builder instance at column level
-
enterStrColumn
Description copied from interface:CategoryBuilderDescend 1 level and enter a new StrColumn.- Specified by:
enterStrColumnin interfaceCategoryBuilder<P extends BlockBuilder<PP>,PP extends CifFileBuilder>- Parameters:
columnName- the name for this column- Returns:
- a parent-aware builder instance at column level
-
registerChild
Description copied from interface:CategoryBuilderMake this builder aware of a child builder at column level. This allows for a somewhat more convenient way to add columns to a category in a more concise fashion.- Specified by:
registerChildin interfaceCategoryBuilder<P extends BlockBuilder<PP>,PP extends CifFileBuilder>- Parameters:
builder- instance to register
-