Class OrderedSet<E>
- java.lang.Object
-
- com.vladsch.flexmark.util.collection.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>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classOrderedSet.IndexedProxy
-
Field Summary
Fields Modifier and Type Field Description private @Nullable Indexed<E>allowConcurrentModsIndexedProxyprivate @Nullable CollectionHost<E>hostprivate @Nullable Indexed<E>indexedProxyprivate @NotNull java.util.HashMap<E,java.lang.Integer>keyMapprivate intmodificationCountprivate @NotNull java.util.BitSetvalidIndices(package private) @NotNull java.util.ArrayList<E>valueList
-
Constructor Summary
Constructors Constructor Description OrderedSet()OrderedSet(int capacity)OrderedSet(int capacity, @Nullable CollectionHost<E> host)OrderedSet(@NotNull CollectionHost<E> host)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(E e)booleanadd(E e, @Nullable java.lang.Object o)booleanaddAll(@NotNull java.util.Collection<? extends E> collection)voidaddNull()voidaddNulls(int index)voidclear()booleancontains(@Nullable java.lang.Object o)booleancontainsAll(@NotNull java.util.Collection<?> collection)@NotNull java.util.BitSetdifferenceBitSet(@NotNull java.lang.Iterable<? extends E> items)@NotNull java.util.BitSetdifferenceBitSet(@NotNull java.util.Iterator<? extends E> items)booleanequals(java.lang.Object o)@NotNull Indexed<E>getConcurrentModsIndexedProxy()@NotNull Indexed<E>getIndexedProxy()(package private) intgetIteratorModificationCount()intgetModificationCount()@NotNull java.util.BitSetgetValidIndices()EgetValue(int index)@NotNull java.util.List<E>getValueList()EgetValueOrNull(int index)inthashCode()static <T1> T1ifNull(T1 o, T1 nullValue)@NotNull java.util.BitSetindexBitSet(@NotNull java.lang.Iterable<? extends E> items)@NotNull ReversibleIterable<java.lang.Integer>indexIterable()@NotNull ReversibleIterator<java.lang.Integer>indexIterator()intindexOf(@Nullable java.lang.Object element)booleaninHostUpdate()booleanisEmpty()booleanisSparse()booleanisValidIndex(int index)@NotNull ReversibleIterable<E>iterable()@NotNull ReversibleIndexedIterator<E>iterator()@NotNull java.util.BitSetkeyDifferenceBitSet(@NotNull java.lang.Iterable<? extends java.util.Map.Entry<? extends E,?>> items)@NotNull java.util.BitSetkeyDifferenceBitSet(@NotNull java.util.Iterator<? extends java.util.Map.Entry<? extends E,?>> items)booleanremove(@Nullable java.lang.Object o)booleanremoveAll(@NotNull java.util.Collection<?> collection)@Nullable java.lang.ObjectremoveHosted(@Nullable java.lang.Object o)booleanremoveIndex(int index)java.lang.ObjectremoveIndexHosted(int index)booleanretainAll(@NotNull java.util.Collection<?> collection)@NotNull ReversibleIterable<java.lang.Integer>reversedIndexIterable()@NotNull ReversibleIterator<java.lang.Integer>reversedIndexIterator()@NotNull ReversibleIterable<E>reversedIterable()@NotNull ReversibleIndexedIterator<E>reversedIterator()booleansetValueAt(int index, E value, @Nullable java.lang.Object o)intsize()@NotNull java.lang.Object[]toArray()<T> @NotNull T[]toArray(@NotNull T[] array)voidvalidateIndex(int index)@NotNull java.util.BitSetvalueDifferenceBitSet(@NotNull java.lang.Iterable<? extends java.util.Map.Entry<?,? extends E>> items)@NotNull java.util.BitSetvalueDifferenceBitSet(@NotNull java.util.Iterator<? extends java.util.Map.Entry<?,? extends E>> items)@NotNull java.util.List<E>values()
-
-
-
Field Detail
-
keyMap
@NotNull private final @NotNull java.util.HashMap<E,java.lang.Integer> keyMap
-
valueList
@NotNull final @NotNull java.util.ArrayList<E> valueList
-
host
@Nullable private final @Nullable CollectionHost<E> host
-
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)
-
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()
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(@Nullable @Nullable java.lang.Object o)
-
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()
-
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 java.lang.Object[] toArray()
-
toArray
@NotNull public <T> @NotNull T[] toArray(@NotNull @NotNull T[] array)
-
add
public boolean add(@Nullable E 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)
-
removeHosted
@Nullable public @Nullable java.lang.Object removeHosted(@Nullable @Nullable java.lang.Object o)
-
containsAll
public boolean containsAll(@NotNull @NotNull java.util.Collection<?> collection)
-
addAll
public boolean addAll(@NotNull @NotNull java.util.Collection<? extends E> collection)
-
retainAll
public boolean retainAll(@NotNull @NotNull java.util.Collection<?> collection)
-
removeAll
public boolean removeAll(@NotNull @NotNull java.util.Collection<?> collection)
-
clear
public void clear()
-
equals
public boolean equals(java.lang.Object o)
-
hashCode
public int hashCode()
-
getValidIndices
@NotNull public @NotNull java.util.BitSet getValidIndices()
-
-