|
PCJ API Version 1.2 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbak.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 Form| Constructor 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 CharSortedSetadd in class AbstractCharCollectionpublic CharIterator iterator()
CharCollection
iterator in interface CharCollectionpublic char first()
CharSortedSet
first in interface CharSortedSetpublic char last()
CharSortedSet
last in interface CharSortedSetpublic CharSortedSet headSet(char to)
CharSortedSet
headSet in interface CharSortedSetto - the upper bound of the returned set (not included).public CharSortedSet tailSet(char from)
CharSortedSet
tailSet in interface CharSortedSetfrom - the lower bound of the returned set (included).
public CharSortedSet subSet(char from,
char to)
CharSortedSet
subSet in interface CharSortedSetfrom - 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 AbstractCharCollectionpublic void trimToSize()
CharCollection
trimToSize in interface CharCollectiontrimToSize in class AbstractCharCollectionpublic Object clone()
public void clear()
CharCollection
clear in interface CharCollectionclear in class AbstractCharCollectionpublic boolean contains(char v)
CharCollection
contains in interface CharCollectioncontains in class AbstractCharCollectionpublic int hashCode()
CharCollection
hashCode in interface CharCollectionhashCode in class AbstractCharSetpublic boolean isEmpty()
CharCollection
isEmpty in interface CharCollectionisEmpty in class AbstractCharCollectionpublic int size()
CharCollection
size in interface CharCollectionsize in class AbstractCharCollectionpublic boolean remove(char v)
CharCollection
remove in interface CharCollectionremove in class AbstractCharCollectionpublic char[] toArray(char[] a)
CharCollection
toArray in interface CharCollectiontoArray in class AbstractCharCollectionpublic 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 | |||||||||