Java org.apache.commons.lang CharSet fields, constructors, methods, implement or subclass

Example usage for Java org.apache.commons.lang CharSet fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.apache.commons.lang CharSet.

The text is from its open source code.

Method

booleancontains(char ch)

Does the CharSet contain the specified character ch.

CharRange[]getCharRanges()

Gets the internal set as an array of CharRange objects.

CharSetgetInstance(String setStr)

Factory method to create a new CharSet using a special syntax.

  • null or empty string ("") - set containing no characters
  • Single character, such as "a" - set containing just that character
  • Multi character, such as "a-e" - set containing characters from one character to the other
  • Negated, such as "^a" or "^a-e" - set containing all characters except those defined
  • Combinations, such as "abe-g" - set containing all the characters from the individual sets

The matching order is:

  1. Negated multi character range, such as "^a-e"
  2. Ordinary multi character range, such as "a-e"
  3. Negated single character, such as "^a"
  4. Ordinary single character, such as "a"

Matching works left to right.