ch.javasoft.util.intcoll
Class BitSetIntSet
java.lang.Object
ch.javasoft.util.intcoll.AbstractIntCollection
ch.javasoft.util.intcoll.AbstractSortedIntSet
ch.javasoft.util.intcoll.BitSetIntSet
- All Implemented Interfaces:
- IntCollection, IntIterable, IntSet, SortedIntSet, Serializable, Cloneable, Iterable<Integer>, Collection<Integer>, Set<Integer>, SortedSet<Integer>
public class BitSetIntSet
- extends AbstractSortedIntSet
- implements Cloneable, Serializable
Implementation of IntSet, also implementing SortedSet, but with
support limited to positive integers.
- See Also:
- Serialized Form
| Methods inherited from class ch.javasoft.util.intcoll.AbstractIntCollection |
add, addAll, addAll, addAll, contains, containsAll, first, hashCode, last, remove, removeAll, retainAll, toArray, toArray, toIntArray, toIntArray |
BitSetIntSet
public BitSetIntSet()
BitSetIntSet
public BitSetIntSet(IntSet set)
BitSetIntSet
public BitSetIntSet(BitSet bitSet)
BitSetIntSet
public BitSetIntSet(int[] values)
toBitSet
public BitSet toBitSet()
size
public int size()
- Specified by:
size in interface Collection<Integer>- Specified by:
size in interface Set<Integer>- Specified by:
size in class AbstractIntCollection
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty in interface Collection<Integer>- Specified by:
isEmpty in interface Set<Integer>- Overrides:
isEmpty in class AbstractIntCollection
containsInt
public boolean containsInt(int o)
- Specified by:
containsInt in interface IntCollection- Overrides:
containsInt in class AbstractIntCollection
iterator
public Iterator<Integer> iterator()
- Specified by:
iterator in interface Iterable<Integer>- Specified by:
iterator in interface Collection<Integer>- Specified by:
iterator in interface Set<Integer>- Overrides:
iterator in class AbstractIntCollection
toArrayInternal
protected <T> T[] toArrayInternal(T[] arr,
boolean checkSize)
- Overrides:
toArrayInternal in class AbstractIntCollection
clear
public void clear()
- Specified by:
clear in interface Collection<Integer>- Specified by:
clear in interface Set<Integer>- Specified by:
clear in class AbstractIntCollection
addInt
public boolean addInt(int value)
- Specified by:
addInt in interface IntCollection- Specified by:
addInt in class AbstractIntCollection
removeInt
public boolean removeInt(int value)
- Specified by:
removeInt in interface IntCollection- Specified by:
removeInt in class AbstractIntCollection
intIterator
public IntIterator intIterator()
- Specified by:
intIterator in interface IntCollection- Specified by:
intIterator in interface IntIterable- Specified by:
intIterator in class AbstractIntCollection
toIntArrayInternal
protected int[] toIntArrayInternal(int[] arr,
boolean checkSize)
- Overrides:
toIntArrayInternal in class AbstractIntCollection
comparator
public Comparator<? super Integer> comparator()
- Specified by:
comparator in interface SortedSet<Integer>
- Returns:
- always null
firstInt
public int firstInt()
- Overrides:
firstInt in class AbstractIntCollection
lastInt
public int lastInt()
- Overrides:
lastInt in class AbstractIntCollection
subSet
public BitSetIntSet subSet(int fromElement,
int toElement)
- Description copied from interface:
SortedIntSet
- Returns a view of the portion of this set whose elements range
from fromElement, inclusive, to toElement,
exclusive. (If fromElement and toElement are
equal, the returned set is empty.) The returned set is backed
by this set, so changes in the returned set are reflected in
this set, and vice-versa. The returned set supports all
optional set operations that this set supports.
The returned set will throw an IllegalArgumentException
on an attempt to insert an element outside its range.
- Specified by:
subSet in interface SortedIntSet
- Parameters:
fromElement - low endpoint (inclusive) of the returned settoElement - high endpoint (exclusive) of the returned set
- Returns:
- a view of the portion of this set whose elements range from
fromElement, inclusive, to toElement, exclusive
clone
public BitSetIntSet clone()
- Overrides:
clone in class AbstractIntCollection
equals
public boolean equals(Object obj)
- Specified by:
equals in interface Collection<Integer>- Specified by:
equals in interface Set<Integer>- Overrides:
equals in class AbstractSortedIntSet
toString
public String toString()
- Overrides:
toString in class AbstractIntCollection