public final class IntCharSet
extends java.lang.Object
[fixme: optimizations possible]
Modifier and Type | Field and Description |
---|---|
private static boolean |
DEBUG |
private java.util.List<Interval> |
intervals |
private int |
pos |
Constructor and Description |
---|
IntCharSet()
Constructor for IntCharSet.
|
IntCharSet(int c)
Constructor for IntCharSet.
|
IntCharSet(Interval interval)
Constructor for IntCharSet.
|
IntCharSet(java.util.List<Interval> chars)
Constructor for IntCharSet.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int c)
add.
|
IntCharSet |
add(IntCharSet set)
add.
|
void |
add(Interval interval)
add.
|
IntCharSet |
and(IntCharSet set)
Intersects two sets.
|
boolean |
contains(int singleChar)
contains.
|
boolean |
containsElements()
Returns whether the set contains elements.
|
IntCharSet |
copy()
Return a (deep) copy of this char set
|
boolean |
equals(java.lang.Object o) |
IntCharSet |
getCaseless(UnicodeProperties unicodeProperties)
Create a caseless version of this charset.
|
java.util.List<Interval> |
getIntervals()
Returns the intervals.
|
Interval |
getNext()
Returns the next interval.
|
private int |
indexOf(int c)
returns the index of the interval that contains the character c, -1 if there is no such
interval
|
private int |
max(int a,
int b) |
private int |
min(int a,
int b) |
int |
numIntervals()
Returns the number of Intervals.
|
void |
sub(IntCharSet set)
Returns the relative complement of this set relative to the provided set.
|
java.lang.String |
toString()
Make a string representation of this char set.
|
private static final boolean DEBUG
private java.util.List<Interval> intervals
private int pos
public IntCharSet()
public IntCharSet(int c)
c
- a int.public IntCharSet(Interval interval)
interval
- a Interval
object.public IntCharSet(java.util.List<Interval> chars)
chars
- a List
object.private int indexOf(int c)
c
- the characterpublic IntCharSet add(IntCharSet set)
set
- a IntCharSet
object.IntCharSet
object.public void add(int c)
c
- a int.public boolean contains(int singleChar)
singleChar
- a int.public boolean equals(java.lang.Object o)
o instanceof Interval
equals
in class java.lang.Object
private int min(int a, int b)
private int max(int a, int b)
public IntCharSet and(IntCharSet set)
set
- a IntCharSet
object.IntCharSet
common to the two sets.public void sub(IntCharSet set)
set
- a IntCharSet
to substract from this set.public boolean containsElements()
public int numIntervals()
public java.util.List<Interval> getIntervals()
List
object.public IntCharSet getCaseless(UnicodeProperties unicodeProperties)
The caseless version contains all characters of this char set, and additionally all lower/upper/title case variants of the characters in this set.
unicodeProperties
- The Unicode Properties to use when generating caseless equivalence
classes.public java.lang.String toString()
toString
in class java.lang.Object
public IntCharSet copy()