Ejemplo n.º 1
0
 /**
  * Creates a new character set which matches a character if that character matches the {@code
  * left} character set but does not match the {@code right} character set.
  *
  * <p>left - right
  *
  * @param left The left source character set.
  * @param right The right source character set.
  */
 public static Chset difference(Chset left, Chset right) {
   Chset n = left.clone();
   for (Range r : right.ranges) {
     n.clear(r);
   }
   return n;
 }
Ejemplo n.º 2
0
 /**
  * Creates a new character set which matches a character if that character matches either the
  * {@code left} or {@code right} character sets.
  *
  * <p>left | right
  *
  * @param left The left source character set.
  * @param right The right source character set.
  */
 public static Chset union(Chset left, Chset right) {
   Chset n = left.clone();
   for (Range r : right.ranges) {
     n.set(r);
   }
   return n;
 }