Class StringList

    • Constructor Detail

      • StringList

        public StringList​(String singleToken)
        Initializes a StringList instance.

        Note:
        Token String will be replaced by identical internal String object.

        Parameters:
        singleToken - One single token
      • StringList

        public StringList​(String... tokens)
        Initializes a StringList instance.

        Note:
        Token Strings will be replaced by identical internal String object.

        Parameters:
        tokens - The string parts of the new StringList. Must not be an empty tokens array or null.
        Throws:
        IllegalArgumentException - Thrown if parameters were invalid.
    • Method Detail

      • getToken

        public String getToken​(int index)
        Parameters:
        index - The index to get a token from.
        Returns:
        Retrieves a token from the given index.
      • size

        public int size()
        Returns:
        Retrieves the number of tokens inside this list.
      • compareToIgnoreCase

        public boolean compareToIgnoreCase​(StringList tokens)
        Compares to token list and ignores the case of the tokens. Note: This can cause problems with some locales.
        Parameters:
        tokens - The tokens used for comparison.
        Returns:
        true if identically with ignore the case, false otherwise.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • toString

        public String toString()
        Overrides:
        toString in class Object
        Returns:
        A human-readable representation of this Span.