Interface CifFile
- All Known Implementing Classes:
BinaryFile,CifCoreFile,DelegatingCifFile,MmCifFile,TextFile
public interface CifFile
The instance of a parsed CifFile. No difference between binary and text files is exposed. This class does not
represent a parsed data model. Rather all source data is neatly wrapped into a type-safe hierarchy of Block,
Category, and Column entities. Parsing (for text data) or decoding (for binary data) is only done,
when the content of particular categories or columns is requested. Otherwise the goal is to keep interaction with the
source data to a bare minimum: just enough to provide this view of the data model.
CifFiles have the following hierarchy:
- 1 CifFile contains 1...n Blocks
- 1 Block contains 1...n Categories
- 1 Category contains 1...n Columns
- 1 Column contains 1...n rows of raw values (int, double, or String)
Missing categories and columns will still be accessible, though the report being undefined and have a row count of
0. Most values in the data structure will be available, but some are missing or unknown. This property of individual
values is reported by the ValueKind property of a Column.
-
Method Summary
Modifier and Type Method Description default <F extends CifFile, B extends CifFileBuilder>
Fas(SchemaProvider<F,B> schemaProvider)Convenience method to access this file wrapped by a given schema.default <F extends CifFile, B extends CifFileBuilder>
FasButWithoutValidation(SchemaProvider<F,B> schemaProvider)Convenience method to access this file wrapped by a given schema.default Stream<? extends Block>blocks()Convenience method to access all blocks as Stream.List<? extends Block>getBlocks()Access to all blocks of this file.
-
Method Details
-
getBlocks
Access to all blocks of this file.- Returns:
- a list of present blocks
-
blocks
Convenience method to access all blocks as Stream.- Returns:
- a Stream of all blocks
-
as
default <F extends CifFile, B extends CifFileBuilder> F as(SchemaProvider<F,B> schemaProvider) throws SchemaMismatchExceptionConvenience method to access this file wrapped by a given schema.- Type Parameters:
F- the file typeB- the builder type- Parameters:
schemaProvider- the schema provider to enforce on this file- Returns:
- this file, honoring a given schema
- Throws:
SchemaMismatchException- if schema is mismatching
-
asButWithoutValidation
default <F extends CifFile, B extends CifFileBuilder> F asButWithoutValidation(SchemaProvider<F,B> schemaProvider) throws SchemaMismatchExceptionConvenience method to access this file wrapped by a given schema. Don't perform any checks whether theSchemaProvideris appropriate for this file.- Type Parameters:
F- the file typeB- the builder type- Parameters:
schemaProvider- the schema provider to enforce on this file- Returns:
- this file, honoring a given schema
- Throws:
SchemaMismatchException
-