Class AsciiSet

java.lang.Object
org.apache.juneau.common.internal.AsciiSet

public final class AsciiSet extends Object
Stores a set of ASCII characters for quick lookup.
  • Method Details

    • create

      public static AsciiSet create(String chars)
      Creates an ASCII set with the specified characters.
      Parameters:
      chars - The characters to keep in this store.
      Returns:
      A new object.
    • create

      public static AsciiSet.Builder create()
      Creates a builder for an ASCII set.
      Returns:
      A new builder.
    • copy

      Copies an existing AsciiSet so that you can augment it with additional values.
      Returns:
      A builder initialized to the same characters in the copied set.
    • contains

      public boolean contains(char c)
      Returns true if the specified character is in this store.
      Parameters:
      c - The character to check.
      Returns:
      true if the specified character is in this store.
    • contains

      public boolean contains(int c)
      Returns true if the specified character is in this store.
      Parameters:
      c - The character to check.
      Returns:
      true if the specified character is in this store.
    • contains

      public boolean contains(CharSequence s)
      Returns true if the specified string contains at least one character in this set.
      Parameters:
      s - The string to test.
      Returns:
      true if the string is not null and contains at least one character in this set.
    • containsOnly

      public boolean containsOnly(String s)
      Returns true if the specified string contains only characters in this set.
      Parameters:
      s - The string to test.
      Returns:
      true if the string contains only characters in this set.
      Nulls always return false.
      Blanks always return true.