Class OrderedSet<E>

  • All Implemented Interfaces:
    java.lang.Iterable<E>, java.util.Collection<E>, java.util.Set<E>

    public class OrderedSet<E>
    extends java.lang.Object
    implements java.util.Set<E>, java.lang.Iterable<E>
    • Field Detail

      • keyMap

        @NotNull
        private final @NotNull java.util.HashMap<E,​java.lang.Integer> keyMap
      • valueList

        @NotNull
        final @NotNull java.util.ArrayList<E> valueList
      • indexedProxy

        @Nullable
        private @Nullable Indexed<E> indexedProxy
      • allowConcurrentModsIndexedProxy

        @Nullable
        private @Nullable Indexed<E> allowConcurrentModsIndexedProxy
      • validIndices

        @NotNull
        private final @NotNull java.util.BitSet validIndices
      • modificationCount

        private int modificationCount
    • Constructor Detail

      • OrderedSet

        public OrderedSet()
      • OrderedSet

        public OrderedSet​(int capacity)
      • OrderedSet

        public OrderedSet​(@NotNull
                          @NotNull CollectionHost<E> host)
      • OrderedSet

        public OrderedSet​(int capacity,
                          @Nullable
                          @Nullable CollectionHost<E> host)
    • Method Detail

      • indexBitSet

        @NotNull
        public @NotNull java.util.BitSet indexBitSet​(@NotNull
                                                     @NotNull java.lang.Iterable<? extends E> items)
      • differenceBitSet

        @NotNull
        public @NotNull java.util.BitSet differenceBitSet​(@NotNull
                                                          @NotNull java.lang.Iterable<? extends E> items)
      • differenceBitSet

        @NotNull
        public @NotNull java.util.BitSet differenceBitSet​(@NotNull
                                                          @NotNull java.util.Iterator<? extends E> items)
      • keyDifferenceBitSet

        @NotNull
        public @NotNull java.util.BitSet keyDifferenceBitSet​(@NotNull
                                                             @NotNull java.lang.Iterable<? extends java.util.Map.Entry<? extends E,​?>> items)
      • keyDifferenceBitSet

        @NotNull
        public @NotNull java.util.BitSet keyDifferenceBitSet​(@NotNull
                                                             @NotNull java.util.Iterator<? extends java.util.Map.Entry<? extends E,​?>> items)
      • valueDifferenceBitSet

        @NotNull
        public @NotNull java.util.BitSet valueDifferenceBitSet​(@NotNull
                                                               @NotNull java.lang.Iterable<? extends java.util.Map.Entry<?,​? extends E>> items)
      • valueDifferenceBitSet

        @NotNull
        public @NotNull java.util.BitSet valueDifferenceBitSet​(@NotNull
                                                               @NotNull java.util.Iterator<? extends java.util.Map.Entry<?,​? extends E>> items)
      • getIndexedProxy

        @NotNull
        public @NotNull Indexed<E> getIndexedProxy()
      • getConcurrentModsIndexedProxy

        @NotNull
        public @NotNull Indexed<E> getConcurrentModsIndexedProxy()
      • getModificationCount

        public int getModificationCount()
      • getIteratorModificationCount

        int getIteratorModificationCount()
      • ifNull

        public static <T1> T1 ifNull​(T1 o,
                                     T1 nullValue)
      • inHostUpdate

        public boolean inHostUpdate()
      • indexOf

        public int indexOf​(@Nullable
                           @Nullable java.lang.Object element)
      • isValidIndex

        public boolean isValidIndex​(int index)
      • validateIndex

        public void validateIndex​(int index)
      • getValue

        @Nullable
        public E getValue​(int index)
      • getValueOrNull

        @Nullable
        public E getValueOrNull​(int index)
      • size

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

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection<E>
        Specified by:
        isEmpty in interface java.util.Set<E>
      • contains

        public boolean contains​(@Nullable
                                @Nullable java.lang.Object o)
        Specified by:
        contains in interface java.util.Collection<E>
        Specified by:
        contains in interface java.util.Set<E>
      • getValueList

        @NotNull
        public @NotNull java.util.List<E> getValueList()
      • values

        @NotNull
        public @NotNull java.util.List<E> values()
      • setValueAt

        public boolean setValueAt​(int index,
                                  @Nullable
                                  E value,
                                  @Nullable
                                  @Nullable java.lang.Object o)
      • isSparse

        public boolean isSparse()
      • addNull

        public void addNull()
      • addNulls

        public void addNulls​(int index)
      • indexIterator

        @NotNull
        public @NotNull ReversibleIterator<java.lang.Integer> indexIterator()
      • reversedIndexIterator

        @NotNull
        public @NotNull ReversibleIterator<java.lang.Integer> reversedIndexIterator()
      • indexIterable

        @NotNull
        public @NotNull ReversibleIterable<java.lang.Integer> indexIterable()
      • reversedIndexIterable

        @NotNull
        public @NotNull ReversibleIterable<java.lang.Integer> reversedIndexIterable()
      • iterator

        @NotNull
        public @NotNull ReversibleIndexedIterator<E> iterator()
        Specified by:
        iterator in interface java.util.Collection<E>
        Specified by:
        iterator in interface java.lang.Iterable<E>
        Specified by:
        iterator in interface java.util.Set<E>
      • toArray

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

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

        public boolean add​(@Nullable
                           E e)
        Specified by:
        add in interface java.util.Collection<E>
        Specified by:
        add in interface java.util.Set<E>
      • add

        public boolean add​(@Nullable
                           E e,
                           @Nullable
                           @Nullable java.lang.Object o)
      • removeIndex

        public boolean removeIndex​(int index)
      • removeIndexHosted

        public java.lang.Object removeIndexHosted​(int index)
      • remove

        public boolean remove​(@Nullable
                              @Nullable java.lang.Object o)
        Specified by:
        remove in interface java.util.Collection<E>
        Specified by:
        remove in interface java.util.Set<E>
      • removeHosted

        @Nullable
        public @Nullable java.lang.Object removeHosted​(@Nullable
                                                       @Nullable java.lang.Object o)
      • containsAll

        public boolean containsAll​(@NotNull
                                   @NotNull java.util.Collection<?> collection)
        Specified by:
        containsAll in interface java.util.Collection<E>
        Specified by:
        containsAll in interface java.util.Set<E>
      • addAll

        public boolean addAll​(@NotNull
                              @NotNull java.util.Collection<? extends E> collection)
        Specified by:
        addAll in interface java.util.Collection<E>
        Specified by:
        addAll in interface java.util.Set<E>
      • retainAll

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

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

        public void clear()
        Specified by:
        clear in interface java.util.Collection<E>
        Specified by:
        clear in interface java.util.Set<E>
      • equals

        public boolean equals​(java.lang.Object o)
        Specified by:
        equals in interface java.util.Collection<E>
        Specified by:
        equals in interface java.util.Set<E>
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Collection<E>
        Specified by:
        hashCode in interface java.util.Set<E>
        Overrides:
        hashCode in class java.lang.Object
      • getValidIndices

        @NotNull
        public @NotNull java.util.BitSet getValidIndices()