Class OrderedSet<E>

java.lang.Object
com.vladsch.flexmark.util.collection.OrderedSet<E>
All Implemented Interfaces:
Iterable<E>, Collection<E>, Set<E>

public class OrderedSet<E> extends Object implements Set<E>, Iterable<E>
  • Field Details

    • keyMap

      @NotNull private final @NotNull HashMap<E,Integer> keyMap
    • valueList

      @NotNull final @NotNull ArrayList<E> valueList
    • host

      @Nullable private final @Nullable CollectionHost<E> host
    • indexedProxy

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

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

      @NotNull private final @NotNull BitSet validIndices
    • modificationCount

      private int modificationCount
  • Constructor Details

    • 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 Details

    • indexBitSet

      @NotNull public @NotNull BitSet indexBitSet(@NotNull @NotNull Iterable<? extends E> items)
    • differenceBitSet

      @NotNull public @NotNull BitSet differenceBitSet(@NotNull @NotNull Iterable<? extends E> items)
    • differenceBitSet

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

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

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

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

      @NotNull public @NotNull BitSet valueDifferenceBitSet(@NotNull @NotNull Iterator<? extends 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 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 Collection<E>
      Specified by:
      size in interface Set<E>
    • isEmpty

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

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

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

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

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

      public boolean isSparse()
    • addNull

      public void addNull()
    • addNulls

      public void addNulls(int index)
    • indexIterator

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

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

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

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

      @NotNull public @NotNull ReversibleIndexedIterator<E> iterator()
      Specified by:
      iterator in interface Collection<E>
      Specified by:
      iterator in interface Iterable<E>
      Specified by:
      iterator in interface Set<E>
    • reversedIterator

      @NotNull public @NotNull ReversibleIndexedIterator<E> reversedIterator()
    • iterable

      @NotNull public @NotNull ReversibleIterable<E> iterable()
    • reversedIterable

      @NotNull public @NotNull ReversibleIterable<E> reversedIterable()
    • toArray

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

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

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

      public boolean add(@Nullable E e, @Nullable @Nullable Object o)
    • removeIndex

      public boolean removeIndex(int index)
    • removeIndexHosted

      public Object removeIndexHosted(int index)
    • remove

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

      @Nullable public @Nullable Object removeHosted(@Nullable @Nullable Object o)
    • containsAll

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

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

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

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

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

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

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

      @NotNull public @NotNull BitSet getValidIndices()