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