Class BitIntegerSet
- java.lang.Object
-
- com.vladsch.flexmark.experimental.util.collection.BitIntegerSet
-
- All Implemented Interfaces:
ReversibleIterable<java.lang.Integer>
,java.lang.Iterable<java.lang.Integer>
,java.util.Collection<java.lang.Integer>
,java.util.Set<java.lang.Integer>
public class BitIntegerSet extends java.lang.Object implements java.util.Set<java.lang.Integer>, ReversibleIterable<java.lang.Integer>
-
-
Field Summary
Fields Modifier and Type Field Description static int[]
EMPTY_INT
-
Constructor Summary
Constructors Constructor Description BitIntegerSet()
BitIntegerSet(int i)
BitIntegerSet(BitIntegerSet other)
BitIntegerSet(java.util.BitSet other)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(java.lang.Integer item)
boolean
addAll(int... collection)
boolean
addAll(int[] collection, int startIndex)
boolean
addAll(int[] collection, int startIndex, int endIndex)
boolean
addAll(java.util.Collection<? extends java.lang.Integer> collection)
BitIntegerSet
and(BitIntegerSet set)
BitIntegerSet
and(java.util.BitSet set)
BitIntegerSet
andNot(BitIntegerSet set)
BitIntegerSet
andNot(java.util.BitSet set)
java.util.BitSet
bitSet()
int
cardinality()
int
cardinality(int start)
int
cardinality(int start, int end)
void
clear()
BitIntegerSet
clear(int i)
BitIntegerSet
clear(int i, int i1)
boolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> collection)
BitIntegerSet
flip(int i)
BitIntegerSet
flip(int i, int i1)
void
forEach(java.util.function.Consumer<? super java.lang.Integer> consumer)
void
forEach(java.util.function.IntConsumer consumer)
boolean
get(int i)
BitIntegerSet
get(int i, int i1)
boolean
intersects(java.util.BitSet set)
boolean
isEmpty()
boolean
isReversed()
ReversibleIterator<java.lang.Integer>
iterator()
int
nextClearBit(int i)
int
nextSetBit(int i)
BitIntegerSet
or(BitIntegerSet set)
BitIntegerSet
or(java.util.BitSet set)
int
previousClearBit(int i)
int
previousSetBit(int i)
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> collection)
boolean
retainAll(java.util.Collection<?> collection)
ReversibleIterable<java.lang.Integer>
reversed()
ReversibleIterator<java.lang.Integer>
reversedIterator()
BitIntegerSet
set(int i)
BitIntegerSet
set(int i, boolean b)
BitIntegerSet
set(int i, int i1)
BitIntegerSet
set(int i, int i1, boolean b)
int
size()
java.lang.Object[]
toArray()
int[]
toArray(int[] array)
int[]
toArray(int[] array, int destinationIndex)
<T> T[]
toArray(T[] array)
byte[]
toByteArray()
long[]
toLongArray()
static BitIntegerSet
valueOf(byte[] bytes)
static BitIntegerSet
valueOf(long[] longs)
static BitIntegerSet
valueOf(java.nio.ByteBuffer buffer)
static BitIntegerSet
valueOf(java.nio.LongBuffer buffer)
BitIntegerSet
xor(BitIntegerSet set)
BitIntegerSet
xor(java.util.BitSet set)
-
-
-
Constructor Detail
-
BitIntegerSet
public BitIntegerSet()
-
BitIntegerSet
public BitIntegerSet(int i)
-
BitIntegerSet
public BitIntegerSet(@NotNull java.util.BitSet other)
-
BitIntegerSet
public BitIntegerSet(@NotNull BitIntegerSet other)
-
-
Method Detail
-
cardinality
public int cardinality()
-
cardinality
public int cardinality(int start)
-
cardinality
public int cardinality(int start, int end)
-
contains
public boolean contains(@Nullable java.lang.Object o)
- Specified by:
contains
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
contains
in interfacejava.util.Set<java.lang.Integer>
-
toArray
@NotNull public java.lang.Object[] toArray()
- Specified by:
toArray
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
toArray
in interfacejava.util.Set<java.lang.Integer>
-
toArray
@NotNull public <T> T[] toArray(@NotNull T[] array)
- Specified by:
toArray
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
toArray
in interfacejava.util.Set<java.lang.Integer>
-
add
public boolean add(@NotNull java.lang.Integer item)
- Specified by:
add
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
add
in interfacejava.util.Set<java.lang.Integer>
-
toArray
@NotNull public int[] toArray(@Nullable int[] array)
-
toArray
@NotNull public int[] toArray(@Nullable int[] array, int destinationIndex)
-
remove
public boolean remove(@Nullable java.lang.Object o)
- Specified by:
remove
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
remove
in interfacejava.util.Set<java.lang.Integer>
-
containsAll
public boolean containsAll(@NotNull java.util.Collection<?> collection)
- Specified by:
containsAll
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
containsAll
in interfacejava.util.Set<java.lang.Integer>
-
addAll
public boolean addAll(int... collection)
-
addAll
public boolean addAll(@NotNull int[] collection, int startIndex)
-
addAll
public boolean addAll(@NotNull int[] collection, int startIndex, int endIndex)
-
addAll
public boolean addAll(@NotNull java.util.Collection<? extends java.lang.Integer> collection)
- Specified by:
addAll
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
addAll
in interfacejava.util.Set<java.lang.Integer>
-
retainAll
public boolean retainAll(@NotNull java.util.Collection<?> collection)
- Specified by:
retainAll
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
retainAll
in interfacejava.util.Set<java.lang.Integer>
-
removeAll
public boolean removeAll(@NotNull java.util.Collection<?> collection)
- Specified by:
removeAll
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
removeAll
in interfacejava.util.Set<java.lang.Integer>
-
forEach
public void forEach(@NotNull java.util.function.Consumer<? super java.lang.Integer> consumer)
- Specified by:
forEach
in interfacejava.lang.Iterable<java.lang.Integer>
-
forEach
public void forEach(@NotNull java.util.function.IntConsumer consumer)
-
size
public int size()
- Specified by:
size
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
size
in interfacejava.util.Set<java.lang.Integer>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
isEmpty
in interfacejava.util.Set<java.lang.Integer>
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
clear
in interfacejava.util.Set<java.lang.Integer>
-
valueOf
@NotNull public static BitIntegerSet valueOf(@NotNull long[] longs)
-
valueOf
@NotNull public static BitIntegerSet valueOf(@NotNull java.nio.LongBuffer buffer)
-
valueOf
@NotNull public static BitIntegerSet valueOf(@NotNull byte[] bytes)
-
valueOf
@NotNull public static BitIntegerSet valueOf(@NotNull java.nio.ByteBuffer buffer)
-
toByteArray
@NotNull public byte[] toByteArray()
-
toLongArray
@NotNull public long[] toLongArray()
-
flip
@NotNull public BitIntegerSet flip(int i)
-
flip
@NotNull public BitIntegerSet flip(int i, int i1)
-
set
@NotNull public BitIntegerSet set(int i)
-
set
@NotNull public BitIntegerSet set(int i, boolean b)
-
set
@NotNull public BitIntegerSet set(int i, int i1)
-
set
@NotNull public BitIntegerSet set(int i, int i1, boolean b)
-
clear
@NotNull public BitIntegerSet clear(int i)
-
clear
@NotNull public BitIntegerSet clear(int i, int i1)
-
and
@NotNull public BitIntegerSet and(@NotNull java.util.BitSet set)
-
or
@NotNull public BitIntegerSet or(@NotNull java.util.BitSet set)
-
xor
@NotNull public BitIntegerSet xor(@NotNull java.util.BitSet set)
-
andNot
@NotNull public BitIntegerSet andNot(@NotNull java.util.BitSet set)
-
and
@NotNull public BitIntegerSet and(@NotNull BitIntegerSet set)
-
or
@NotNull public BitIntegerSet or(@NotNull BitIntegerSet set)
-
xor
@NotNull public BitIntegerSet xor(@NotNull BitIntegerSet set)
-
andNot
@NotNull public BitIntegerSet andNot(@NotNull BitIntegerSet set)
-
get
public boolean get(int i)
-
get
@NotNull public BitIntegerSet get(int i, int i1)
-
nextSetBit
public int nextSetBit(int i)
-
nextClearBit
public int nextClearBit(int i)
-
previousSetBit
public int previousSetBit(int i)
-
previousClearBit
public int previousClearBit(int i)
-
intersects
public boolean intersects(java.util.BitSet set)
-
bitSet
@NotNull public java.util.BitSet bitSet()
-
iterator
@NotNull public ReversibleIterator<java.lang.Integer> iterator()
- Specified by:
iterator
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
iterator
in interfacejava.lang.Iterable<java.lang.Integer>
- Specified by:
iterator
in interfaceReversibleIterable<java.lang.Integer>
- Specified by:
iterator
in interfacejava.util.Set<java.lang.Integer>
-
reversed
@NotNull public ReversibleIterable<java.lang.Integer> reversed()
- Specified by:
reversed
in interfaceReversibleIterable<java.lang.Integer>
-
isReversed
public boolean isReversed()
- Specified by:
isReversed
in interfaceReversibleIterable<java.lang.Integer>
-
reversedIterator
@NotNull public ReversibleIterator<java.lang.Integer> reversedIterator()
- Specified by:
reversedIterator
in interfaceReversibleIterable<java.lang.Integer>
-
-