Package org.rcsb.cif

Class CifOptions.CifOptionsBuilder

  • Enclosing class:
    CifOptions

    public static class CifOptions.CifOptionsBuilder
    extends Object
    Internal class to handle the option building process.
    • Constructor Detail

      • CifOptionsBuilder

        public CifOptionsBuilder()
    • Method Detail

      • generic

        public CifOptions.CifOptionsBuilder generic​(boolean generic)
        Allow for 'generic' reading: no types will be inferred and all categories and columns will be the untyped, 'generic' base implementations of categories and columns. Be careful: this will cause any previously type-safe method (e.g. Block.getAtomSite() to now throw a ClassCastException. The only way to access categories/column is by getting them explicitly by name.
        Parameters:
        generic - true will omit type-safe access to categories and columns
        Returns:
        this builder instance
      • gzip

        public CifOptions.CifOptionsBuilder gzip​(boolean gzip)
        Allows for downstream GZIP operations.
        Parameters:
        gzip - true if the output should be gzipped
        Returns:
        this builder instance
      • encoder

        public CifOptions.CifOptionsBuilder encoder​(String encoder)
        The name of the encoder which should be written to files.
        Parameters:
        encoder - String representing the encoder name
        Returns:
        this builder instance
      • fetchUrl

        public CifOptions.CifOptionsBuilder fetchUrl​(String fetchUrl)
        The URL from which files should be fetched - must follow the pattern: www.source.com/%s.cif, where %s represents the pdbId to be inserted into the URL to fetch the correct file.
        Parameters:
        fetchUrl - the specified fetch URL
        Returns:
        this builder instance
      • categoryWhitelist

        public CifOptions.CifOptionsBuilder categoryWhitelist​(String... categoryWhitelist)
        Add entries to the category whitelist. If the whitelist has any entries, the category must be explicitly contained for the category to appear in the output.
        Parameters:
        categoryWhitelist - a collection of String values to explicitly include in the output, all other possible entries will be implicitly excluded
        Returns:
        this builder instance
      • categoryWhitelist

        public CifOptions.CifOptionsBuilder categoryWhitelist​(List<String> categoryWhitelist)
        Add entries to the category whitelist. If the whitelist has any entries, the category must be explicitly contained for the category to appear in the output.
        Parameters:
        categoryWhitelist - a collection of String values to explicitly include in the output, all other possible entries will be implicitly excluded
        Returns:
        this builder instance
      • categoryBlacklist

        public CifOptions.CifOptionsBuilder categoryBlacklist​(String... categoryBlacklist)
        Add entries to the category blacklist. Any entries will be ignored when composing the output.
        Parameters:
        categoryBlacklist - a collection of String values to explicitly exclude from the output, all other possible entries will be implicitly included
        Returns:
        this builder instance
      • categoryBlacklist

        public CifOptions.CifOptionsBuilder categoryBlacklist​(List<String> categoryBlacklist)
        Add entries to the category blacklist. Any entries will be ignored when composing the output.
        Parameters:
        categoryBlacklist - a collection of String values to explicitly exclude from the output, all other possible entries will be implicitly included
        Returns:
        this builder instance
      • columnWhitelist

        public CifOptions.CifOptionsBuilder columnWhitelist​(String... columnWhitelist)
        Add entries to the column whitelist. If the whitelist has any entries, the column must be explicitly contained for the column to appear in the output. Names follow the pattern category_name.column_name.
        Parameters:
        columnWhitelist - a collection of String values to explicitly include in the output, all other possible entries will be implicitly excluded
        Returns:
        this builder instance
      • columnWhitelist

        public CifOptions.CifOptionsBuilder columnWhitelist​(List<String> columnWhitelist)
        Add entries to the column whitelist. If the whitelist has any entries, the column must be explicitly contained for the column to appear in the output. Names follow the pattern category_name.column_name.
        Parameters:
        columnWhitelist - a collection of String values to explicitly include in the output, all other possible entries will be implicitly excluded
        Returns:
        this builder instance
      • columnBlacklist

        public CifOptions.CifOptionsBuilder columnBlacklist​(String... columnBlacklist)
        Add entries to the column blacklist. Any entries will be ignored when composing the output. Names follow the pattern category_name.column_name.
        Parameters:
        columnBlacklist - a collection of String values to explicitly exclude from the output, all other possible entries will be implicitly included
        Returns:
        this builder instance
      • columnBlacklist

        public CifOptions.CifOptionsBuilder columnBlacklist​(List<String> columnBlacklist)
        Add entries to the column blacklist. Any entries will be ignored when composing the output. Names follow the pattern category_name.column_name.
        Parameters:
        columnBlacklist - a collection of String values to explicitly exclude from the output, all other possible entries will be implicitly included
        Returns:
        this builder instance
      • encodingStrategyHint

        public CifOptions.CifOptionsBuilder encodingStrategyHint​(String categoryName,
                                                                 String columnName,
                                                                 String encoding,
                                                                 int precision)
        Manually specify encoding strategy and precision for a column.
        Parameters:
        categoryName - the category name
        columnName - the column name
        encoding - the encoding to employ: "pack" | "rle" | "delta" | "delta-rle"
        precision - the number of decimal places to keep during FixedPointEncoding
        Returns:
        this builder instance
      • encodingStrategyHint

        public CifOptions.CifOptionsBuilder encodingStrategyHint​(EncodingStrategyHint... encodingStrategyHints)
        Manually specify encoding strategy and precision for a column.
        Parameters:
        encodingStrategyHints - the hints to process
        Returns:
        this builder instance
      • encodingStrategyHint

        public CifOptions.CifOptionsBuilder encodingStrategyHint​(List<EncodingStrategyHint> encodingStrategyHints)
        Manually specify encoding strategy and precision for a column.
        Parameters:
        encodingStrategyHints - the hints to process
        Returns:
        this builder instance
      • fileFormatHint

        public CifOptions.CifOptionsBuilder fileFormatHint​(CifOptions.CifOptionsBuilder.FileFormat fileFormat)
        The library can automatically detect compression and file format. This involves some guessing and can be omitted by specifying the format explicitly. This may increase performance and will improve safety when malformed or unexpected files are handled.
        Parameters:
        fileFormat - an instance of the supported file formats
        Returns:
        this builder instance