|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CharCollection
Defines a collection of primitive char
values.
This interface extends Collection
allowing
seamless integration with other APIs.
All Collection methods can be used, using the primitive wrapper class Character
.
However, it will be much more efficient to use the methods defined here.
Method Summary | |
---|---|
boolean |
add(char value)
Adds a primitive value to this collection (optional operation). |
boolean |
addAll(char[] values)
Adds an array of primitive values to this collection (optional operation). |
boolean |
addAll(char startInclusive,
char endInclusive)
Adds a range of primitive values to this collection (optional operation). |
boolean |
addAll(CharCollection values)
Adds a collection of primitive values to this collection (optional operation). |
boolean |
contains(char value)
Checks whether this collection contains a specified primitive value. |
boolean |
containsAll(char[] values)
Checks if this collection contains all of the values in the specified array. |
boolean |
containsAll(char startInclusive,
char endInclusive)
Checks if this collection contain all the values in the specified range. |
boolean |
containsAll(CharCollection values)
Checks if this collection contains all of the values in the specified collection. |
boolean |
containsAny(char[] values)
Checks if this collection contains any of the values in the specified array. |
boolean |
containsAny(char startInclusive,
char endInclusive)
Checks if this collection contain any of the values in the specified range. |
boolean |
containsAny(CharCollection coll)
Checks if this collection contains any of the values in the specified collection. |
CharIterator |
iterator()
Gets an iterator over this collection capable of accessing the primitive values. |
boolean |
removeAll(char value)
Removes all occurrences of the specified primitive value from this collection (optional operation). |
boolean |
removeAll(char[] values)
Removes all occurrences from this collection of each primitive in the specified array (optional operation). |
boolean |
removeAll(char startInclusive,
char endInclusive)
Removes all occurrences of a range of primitive values from this collection (optional operation). |
boolean |
removeAll(CharCollection values)
Removes all occurrences from this collection of each primitive in the specified collection (optional operation). |
boolean |
removeFirst(char value)
Removes the first occurrence of the specified primitive value from this collection (optional operation). |
boolean |
retainAll(char[] values)
Retains each element of this collection that is present in the specified array removing all other values (optional operation). |
boolean |
retainAll(char startInclusive,
char endInclusive)
Retains all occurrences of a range of primitive values within this collection removing all values outside the range (optional operation). |
boolean |
retainAll(CharCollection values)
Retains each element of this collection that is present in the specified collection removing all other values (optional operation). |
char[] |
toCharArray()
Gets the elements of this collection as an array. |
char[] |
toCharArray(char[] array,
int startIndex)
Copies the elements of this collection into an array at a specified position. |
Methods inherited from interface org.joda.primitives.collection.PrimitiveCollection |
---|
containsAny |
Methods inherited from interface org.joda.primitives.PrimitiveCollectable |
---|
clear, clone, isEmpty, isModifiable, optimize, size |
Methods inherited from interface java.util.Collection |
---|
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, size, toArray, toArray |
Method Detail |
---|
CharIterator iterator()
iterator
in interface CharIterable
iterator
in interface Collection<Character>
iterator
in interface Iterable<Character>
boolean contains(char value)
value
- the value to search for
true
if the value is foundboolean containsAll(char[] values)
true
is returned.
values
- the values to search for, null treated as empty array
true
if all of the values are foundboolean containsAll(CharCollection values)
true
is returned.
values
- the values to search for, null treated as empty collection
true
if all of the values are foundboolean containsAll(char startInclusive, char endInclusive)
The range is defined to be inclusive of the start and end.
If the start is greater than the end then the result is true
as the range is equivalent to an empty collection.
startInclusive
- the inclusive range start valueendInclusive
- the inclusive range end value
true
if the collection contains the entire rangeboolean containsAny(char[] values)
false
is returned.
values
- the values to search for, null treated as empty array
true
if at least one of the values is foundboolean containsAny(CharCollection coll)
false
is returned.
coll
- the values to search for, null treated as empty collection
true
if at least one of the values is foundboolean containsAny(char startInclusive, char endInclusive)
The range is defined to be inclusive of the start and end.
If the start is greater than the end then the result is false
as the range is equivalent to an empty collection.
startInclusive
- the inclusive range start valueendInclusive
- the inclusive range end value
true
if the collection contains at least one of the rangechar[] toCharArray()
char[] toCharArray(char[] array, int startIndex)
If the array specified is null a new array is created. If the array specified is large enough, it will be modified. If the array is not large enough, a new array will be created containing the values from the specified array before the startIndex plus those from this collection.
array
- the array to add the elements to, null creates new arraystartIndex
- the position in the array to start setting elements
IndexOutOfBoundsException
- if the index is negativeboolean add(char value)
This method is optional, throwing an UnsupportedOperationException if the collection cannot be added to.
value
- the value to add to this collection
true
if this collection was modified by this method call
IllegalArgumentException
- if value is rejected by this collection
UnsupportedOperationException
- if not supported by this collectionboolean addAll(char[] values)
This method is optional, throwing an UnsupportedOperationException if the collection cannot be added to.
values
- the values to add to this collection, null treated as empty array
true
if this collection was modified by this method call
IllegalArgumentException
- if a value is rejected by this collection
UnsupportedOperationException
- if not supported by this collectionboolean addAll(CharCollection values)
This method is optional, throwing an UnsupportedOperationException if the collection cannot be added to.
values
- the values to add to this collection, null treated as empty collection
true
if this collection was modified by this method call
IllegalArgumentException
- if a value is rejected by this collection
UnsupportedOperationException
- if not supported by this collectionboolean addAll(char startInclusive, char endInclusive)
The range is defined to be inclusive of the start and end. If the start is greater than the end then the range is equivalent to an empty collection.
This method is optional, throwing an UnsupportedOperationException if the collection cannot be added to.
startInclusive
- the inclusive range start valueendInclusive
- the inclusive range end value
true
if this collection was modified by this method call
IllegalArgumentException
- if a value is rejected by this set
UnsupportedOperationException
- if not supported by this setboolean removeFirst(char value)
This method is optional, throwing an UnsupportedOperationException if the collection cannot be removed from.
value
- the value to remove
true
if this collection was modified by this method call
UnsupportedOperationException
- if not supported by this collectionboolean removeAll(char value)
This method is optional, throwing an UnsupportedOperationException if the collection cannot be removed from.
value
- the value to remove
true
if this collection was modified by this method call
UnsupportedOperationException
- if not supported by this collectionboolean removeAll(char[] values)
This method is optional, throwing an UnsupportedOperationException if the collection cannot be removed from.
values
- the values to remove from this collection, null treated as empty array
true
if this collection was modified by this method call
UnsupportedOperationException
- if not supported by this collectionboolean removeAll(CharCollection values)
This method is optional, throwing an UnsupportedOperationException if the collection cannot be removed from.
values
- the values to remove from this collection, null treated as empty collection
true
if this collection was modified by this method call
UnsupportedOperationException
- if not supported by this collectionboolean removeAll(char startInclusive, char endInclusive)
The range is defined to be inclusive of the start and end. The elements removed are greater than or equal to the start and less than or equal to the end. Thus if the start is greater than the end then no elements are removed.
This method is optional, throwing an UnsupportedOperationException if the set cannot be changed.
startInclusive
- the inclusive range start valueendInclusive
- the inclusive range end value
true
if this collection was modified by this method call
UnsupportedOperationException
- if not supported by this collectionboolean retainAll(char[] values)
This method is optional, throwing an UnsupportedOperationException if the collection cannot be removed from.
values
- the values to retain in this collection, null treated as empty array
true
if this collection was modified by this method call
UnsupportedOperationException
- if not supported by this collectionboolean retainAll(CharCollection values)
This method is optional, throwing an UnsupportedOperationException if the collection cannot be removed from.
values
- the values to retain in this collection, null treated as empty collection
true
if this collection was modified by this method call
UnsupportedOperationException
- if not supported by this collectionboolean retainAll(char startInclusive, char endInclusive)
The range is defined to be inclusive of the start and end. If the start is greater than the end then the range is equivalent to an empty collection.
This method is optional, throwing an UnsupportedOperationException if the set cannot be changed.
startInclusive
- the inclusive range start valueendInclusive
- the inclusive range end value
true
if this collection was modified by this method call
UnsupportedOperationException
- if not supported by this collection
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |