Class 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 Detail

      • EMPTY_INT

        public static final int[] EMPTY_INT
      • myBits

        @NotNull
        private final @NotNull java.util.BitSet myBits
      • myReversed

        private final boolean myReversed
    • 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 interface java.util.Collection<java.lang.Integer>
        Specified by:
        contains in interface java.util.Set<java.lang.Integer>
      • toArray

        @NotNull
        public @NotNull java.lang.Object[] toArray()
        Specified by:
        toArray in interface java.util.Collection<java.lang.Integer>
        Specified by:
        toArray in interface java.util.Set<java.lang.Integer>
      • toArray

        @NotNull
        public <T> @NotNull T[] toArray​(@NotNull
                                        @NotNull T[] array)
        Specified by:
        toArray in interface java.util.Collection<java.lang.Integer>
        Specified by:
        toArray in interface java.util.Set<java.lang.Integer>
      • add

        public boolean add​(@NotNull
                           @NotNull java.lang.Integer item)
        Specified by:
        add in interface java.util.Collection<java.lang.Integer>
        Specified by:
        add in interface java.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 interface java.util.Collection<java.lang.Integer>
        Specified by:
        remove in interface java.util.Set<java.lang.Integer>
      • containsAll

        public boolean containsAll​(@NotNull
                                   @NotNull java.util.Collection<?> collection)
        Specified by:
        containsAll in interface java.util.Collection<java.lang.Integer>
        Specified by:
        containsAll in interface java.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 interface java.util.Collection<java.lang.Integer>
        Specified by:
        addAll in interface java.util.Set<java.lang.Integer>
      • retainAll

        public boolean retainAll​(@NotNull
                                 @NotNull java.util.Collection<?> collection)
        Specified by:
        retainAll in interface java.util.Collection<java.lang.Integer>
        Specified by:
        retainAll in interface java.util.Set<java.lang.Integer>
      • removeAll

        public boolean removeAll​(@NotNull
                                 @NotNull java.util.Collection<?> collection)
        Specified by:
        removeAll in interface java.util.Collection<java.lang.Integer>
        Specified by:
        removeAll in interface java.util.Set<java.lang.Integer>
      • forEach

        public void forEach​(@NotNull
                            @NotNull java.util.function.Consumer<? super java.lang.Integer> consumer)
        Specified by:
        forEach in interface java.lang.Iterable<java.lang.Integer>
      • forEach

        public void forEach​(@NotNull
                            @NotNull java.util.function.IntConsumer consumer)
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<java.lang.Integer>
        Specified by:
        size in interface java.util.Set<java.lang.Integer>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection<java.lang.Integer>
        Specified by:
        isEmpty in interface java.util.Set<java.lang.Integer>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<java.lang.Integer>
        Specified by:
        clear in interface java.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,
                                           int i1)
      • 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)
      • 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 interface java.util.Collection<java.lang.Integer>
        Specified by:
        iterator in interface java.lang.Iterable<java.lang.Integer>
        Specified by:
        iterator in interface ReversibleIterable<java.lang.Integer>
        Specified by:
        iterator in interface java.util.Set<java.lang.Integer>