Tests whether this CharSet contain the specified character ch. Examples using the negation character: CharSet.getInstance("^a-c").contains('a') = false CharSet.getInstance("^a-c").contains('d') = true CharSet.getInstance("^^a-c").contains('a') = true // (on
(final char ch)
| 237 | * @return {@code true} if the set contains the characters. |
| 238 | */ |
| 239 | public boolean contains(final char ch) { |
| 240 | synchronized (set) { |
| 241 | return set.stream().anyMatch(range -> range.contains(ch)); |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | /** |
| 246 | * Compares two {@link CharSet} objects, returning true if they represent |