Package org.rcsb.cif
Class CifOptions
java.lang.Object
org.rcsb.cif.CifOptions
public class CifOptions extends Object
Allows to set options for CIF writing. Acquire by calling builder(). Pass into CifIO
functions. Use white- and blacklist functions to select a subset of categories and/or columns to write. If a value is
present in both white- and blacklist, the blacklist values will trump the whitelist.
For now only writer classes will respect these options. They can be passed to reader classes as well, however there are currently no relevant options for CIF reading.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCifOptions.CifOptionsBuilderInternal class to handle the option building process. -
Method Summary
Modifier and Type Method Description static CifOptions.CifOptionsBuilderbuilder()Acquire the actual builder instance.booleanfilterCategory(String categoryName)Checks whether this category should be written to output files.booleanfilterColumn(String categoryName, String columnName)Checks whether this column should be written to output files.StringgetEncoder()The name of the encoder which should be written to files.Optional<EncodingStrategyHint>getEncodingStrategyHint(String categoryName, String columnName)Reports whether a particular encoding or floating-point precision is specified for this particular column.StringgetFetchUrl()The URL from which files should be fetched - must follow the pattern:www.source.com/%s.cif, where%srepresents the pdbId to be inserted into the URL to fetch the correct file.CifOptions.CifOptionsBuilder.FileFormatgetFileFormat()Reports if the input file format was specified for reading.booleanisGzip()Allows for downstream GZIP operations.
-
Method Details
-
isGzip
public boolean isGzip()Allows for downstream GZIP operations.- Returns:
trueif the output should be gzipped
-
getEncoder
The name of the encoder which should be written to files.- Returns:
- a String representing the encoder name
-
getFetchUrl
The URL from which files should be fetched - must follow the pattern:www.source.com/%s.cif, where%srepresents the pdbId to be inserted into the URL to fetch the correct file.- Returns:
- the specified fetch URL
-
filterCategory
Checks whether this category should be written to output files. Specify via the white- and blacklists.- Parameters:
categoryName- the category name to check- Returns:
trueif this category should be written to output files- See Also:
CifOptions.CifOptionsBuilder.categoryWhitelist(String...),CifOptions.CifOptionsBuilder.categoryBlacklist(String...)
-
filterColumn
Checks whether this column should be written to output files. Specify via the white- and blacklists.- Parameters:
categoryName- the category name to checkcolumnName- the column name to check- Returns:
trueif this column should be written to output files- See Also:
CifOptions.CifOptionsBuilder.columnWhitelist(String...),CifOptions.CifOptionsBuilder.columnBlacklist(String...)
-
getEncodingStrategyHint
public Optional<EncodingStrategyHint> getEncodingStrategyHint(String categoryName, String columnName)Reports whether a particular encoding or floating-point precision is specified for this particular column.- Parameters:
categoryName- the category name to checkcolumnName- the column name to check- Returns:
- an optional wrapping an
EncodingStrategyHint
-
getFileFormat
Reports if the input file format was specified for reading.- Returns:
- the
CifOptions.CifOptionsBuilder.FileFormatif set andnullotherwise
-
builder
Acquire the actual builder instance.- Returns:
- a
CifOptions.CifOptionsBuilder
-