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 intoCifIOfunctions. 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
All Methods Static Methods Instance Methods Concrete Methods 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.booleanisGeneric()Reading should not care about category and column types.booleanisGzip()Allows for downstream GZIP operations.
-
-
-
Method Detail
-
isGeneric
public boolean isGeneric()
Reading should not care about category and column types.- Returns:
trueif reading should be untyped
-
isGzip
public boolean isGzip()
Allows for downstream GZIP operations.- Returns:
trueif the output should be gzipped
-
getEncoder
public String getEncoder()
The name of the encoder which should be written to files.- Returns:
- a String representing the encoder name
-
getFetchUrl
public String 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
public boolean filterCategory(String categoryName)
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
public boolean filterColumn(String categoryName, String columnName)
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
public CifOptions.CifOptionsBuilder.FileFormat getFileFormat()
Reports if the input file format was specified for reading.- Returns:
- the
CifOptions.CifOptionsBuilder.FileFormatif set andnullotherwise
-
builder
public static CifOptions.CifOptionsBuilder builder()
Acquire the actual builder instance.- Returns:
- a
CifOptions.CifOptionsBuilder
-
-