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.
        Maximum length of encoded lines, or -1 if infinite.
      • getLineDelimiter

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

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

        public String getWordDelimiter()
        Retrieve the delimiter inserted between each word by the encoder.
        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 "_".

        A predicate matching characters that will be skipped.
      • defaultConfig

        public static BitspeakConfig defaultConfig()
        Retrieve the default bitspeak configuration.
        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.

        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.

        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-
        template - the configuration to copy, or NULL to use default values.
        a new builder.
      • hashCode

        public int hashCode()
        hashCode in class Object