Class BitspeakConfig


  • public class BitspeakConfig
    extends Object
    Represents a bitspeak format configuration for line and word delimiters.

    This enables customizing the maximum number of characters per word (default is 8) and per line (default is 160), before the encoder will output a delimiter, along with the specific delimiters between each word (default is "-") and line (default is the current line terminator).

    It is also possible to specify the characters that are considered skippable whitepace (by default, whitespace, "-" and "_").
    • Method Detail

      • getMaxLineSize

        public int getMaxLineSize()
        Retrieve the maximum number of characters, including delimiters, in each encoded line.
        Returns:
        Maximum length of encoded lines, or -1 if infinite.
      • getLineDelimiter

        public String getLineDelimiter()
        Retrieve the delimiter inserted between each line by the encoder.
        Returns:
        The word delimiter.
      • getMaxWordSize

        public int getMaxWordSize()
        Retrieve the maximum length of each encoded word.
        Returns:
        Maximum length of encoded words, or -1 if infinite.
      • getWordDelimiter

        public String getWordDelimiter()
        Retrieve the delimiter inserted between each word by the encoder.
        Returns:
        The word delimiter.
      • getSkipCharPredicate

        public CharPredicate getSkipCharPredicate()
        Retrieve the predicate that matches characters that will be silently skipped by the decoder.

        By default, this is all whitespace characters as given by Character.isWhitespace(char) and the special characters "-" and "_".

        Returns:
        A predicate matching characters that will be skipped.
      • defaultConfig

        public static BitspeakConfig defaultConfig()
        Retrieve the default bitspeak configuration.
        Returns:
        The default configuration.
      • unlimitedWordSize

        public static BitspeakConfig unlimitedWordSize()
        Retrieve a bitspeak configuration with infinite word and line sizes, disabling insertion of word and line delimiters.

        The skip char predicate is the same as the default.

        Returns:
        A bitspeak configuration.
      • newBuilder

        public static BitspeakConfig.Builder newBuilder()
        Retrieve a new builder of bitspeak configuration instances.

        The builder is initialized to the default values.

        Returns:
        A new builder.
      • newBuilder

        public static BitspeakConfig.Builder newBuilder​(BitspeakConfig template)
        Retrieve a new builder of bitspeak configuration instances, initialized as a copy of the given configuration-
        Parameters:
        template - the configuration to copy, or NULL to use default values.
        Returns:
        a new builder.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object