|
PCJ API Version 1.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bak.pcj.AbstractCharCollection bak.pcj.set.AbstractCharSet bak.pcj.set.CharRangeSet
This class represents range based sets of char values. The implementation is optimized for cases where most set elements fall into ranges of consecutive char values.
Implementation of CharSortedSet is supported from PCJ 1.2. Prior to 1.2, only CharSet was implemented.
CharRange
,
Serialized FormConstructor Summary | |
CharRangeSet()
Creates a new empty range set. |
|
CharRangeSet(char[] a)
Creates a new empty range set containing specified values. |
|
CharRangeSet(CharCollection c)
Creates a new range set with the same elements as a specified collection. |
Method Summary | |
boolean |
add(char v)
Adds an element to this set. |
boolean |
addAll(char[] a)
Adds an array of char values to this set. |
boolean |
addAll(char first,
char last)
Adds a specified range to this set. |
boolean |
addAll(CharRange range)
Adds a specified range to this set. |
boolean |
addAll(CharRangeSet c)
Adds all the elements of a specified range set to this set. |
void |
clear()
Clears this collection. |
Object |
clone()
Returns a clone of this range set. |
boolean |
contains(char v)
Indicates whether this collection contains a specified element. |
boolean |
containsAll(CharRange range)
Indicates whether all elements of a specified range is contained in this set. |
char |
first()
Returns the lowest element of this set. |
int |
hashCode()
Returns a hash code value for this collection. |
CharSortedSet |
headSet(char to)
Returns the subset of values lower than a specified value. |
boolean |
isEmpty()
Indicates whether this collection is empty. |
CharIterator |
iterator()
Returns an iterator over this collection. |
char |
last()
Returns the highest element of this set. |
CharRange[] |
ranges()
Returns the ranges of this set. |
boolean |
remove(char v)
Removes a specified element from this collection. |
int |
size()
Returns the number of elements in this collection. |
CharSortedSet |
subSet(char from,
char to)
Returns the subset of values lower that a specified value and higher than or equal to another specified value. |
CharSortedSet |
tailSet(char from)
Returns the subset of values higher than or equal to a specified value. |
char[] |
toArray(char[] a)
Returns the elements of this collection as an array. |
String |
toString()
Returns a string representation of this collection. |
void |
trimToSize()
Minimizes the memory used by this collection. |
Methods inherited from class bak.pcj.set.AbstractCharSet |
equals |
Methods inherited from class bak.pcj.AbstractCharCollection |
addAll, containsAll, removeAll, retainAll, toArray |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface bak.pcj.CharCollection |
addAll, containsAll, equals, removeAll, retainAll, toArray |
Constructor Detail |
public CharRangeSet()
public CharRangeSet(char[] a)
a
- the values that the new set should contain.
NullPointerException
- if a is null.public CharRangeSet(CharCollection c)
c
- the collection whose elements to add to the new
set.
NullPointerException
- if c is null.Method Detail |
public boolean add(char v)
CharSortedSet
add
in interface CharSortedSet
add
in class AbstractCharCollection
public CharIterator iterator()
CharCollection
iterator
in interface CharCollection
public char first()
CharSortedSet
first
in interface CharSortedSet
public char last()
CharSortedSet
last
in interface CharSortedSet
public CharSortedSet headSet(char to)
CharSortedSet
headSet
in interface CharSortedSet
to
- the upper bound of the returned set (not included).public CharSortedSet tailSet(char from)
CharSortedSet
tailSet
in interface CharSortedSet
from
- the lower bound of the returned set (included).public CharSortedSet subSet(char from, char to)
CharSortedSet
subSet
in interface CharSortedSet
from
- the lower bound of the returned set (included).to
- the upper bound of the returned set (not included).public String toString()
AbstractCharCollection
toString
in class AbstractCharCollection
public void trimToSize()
CharCollection
trimToSize
in interface CharCollection
trimToSize
in class AbstractCharCollection
public Object clone()
public void clear()
CharCollection
clear
in interface CharCollection
clear
in class AbstractCharCollection
public boolean contains(char v)
CharCollection
contains
in interface CharCollection
contains
in class AbstractCharCollection
public int hashCode()
CharCollection
hashCode
in interface CharCollection
hashCode
in class AbstractCharSet
public boolean isEmpty()
CharCollection
isEmpty
in interface CharCollection
isEmpty
in class AbstractCharCollection
public int size()
CharCollection
size
in interface CharCollection
size
in class AbstractCharCollection
public boolean remove(char v)
CharCollection
remove
in interface CharCollection
remove
in class AbstractCharCollection
public char[] toArray(char[] a)
CharCollection
toArray
in interface CharCollection
toArray
in class AbstractCharCollection
public boolean containsAll(CharRange range)
range
- the range whose elements to test for
containment.
NullPointerException
- if range is null.AbstractCharCollection.containsAll(CharCollection)
public boolean addAll(CharRangeSet c)
c
- the set whose elements to add to this
set.
NullPointerException
- if c is null.add(char)
,
addAll(CharRange)
,
AbstractCharCollection.addAll(CharCollection)
,
addAll(char, char)
,
addAll(char[])
public boolean addAll(CharRange range)
range
- the range to add to this set.
NullPointerException
- if range is null.add(char)
,
addAll(CharRangeSet)
,
AbstractCharCollection.addAll(CharCollection)
,
addAll(char, char)
,
addAll(char[])
public boolean addAll(char first, char last)
first
- the first value of the range to add to this set.last
- the last value of the range to add to this set.
IllegalArgumentException
- if first > last.public boolean addAll(char[] a)
a
- the array of char values to add to this set.
NullPointerException
- if a is null.add(char)
,
addAll(CharRange)
,
addAll(CharRangeSet)
,
AbstractCharCollection.addAll(CharCollection)
,
addAll(char, char)
public CharRange[] ranges()
|
PCJ API Version 1.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |