CharSequenceDiscriminator

A CharSequenceDiscriminator discriminates CharSequences, which includes Strings, StringBuffers, and StringBuilders. It doesn't matter which concrete subclass of CharSequence is present; this Discriminator will discriminate them. It discriminates its input by calling charAt to extract the character values, then discriminating directly on the byte values.

Example

Given the input...

  • {"jAgg", "", "abcd", "", "jAgg", "jagg", "ABCD", " ", "jAgg", "ABCD"}

... a CharSequenceDiscriminator returns the following equivalence classes:

  • {"abcd"}
  • {"jagg"}
  • {" "}
  • {"jAgg", "jAgg", "jAgg"}
  • {"", ""}
  • {"ABCD", "ABCD"}