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 class
OrderedSet.IndexedProxy
-
Field Summary
Fields Modifier and Type Field Description private @Nullable Indexed<E>
allowConcurrentModsIndexedProxy
private @Nullable CollectionHost<E>
host
private @Nullable Indexed<E>
indexedProxy
private @NotNull java.util.HashMap<E,java.lang.Integer>
keyMap
private int
modificationCount
private @NotNull java.util.BitSet
validIndices
(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 boolean
add(E e)
boolean
add(E e, @Nullable java.lang.Object o)
boolean
addAll(@NotNull java.util.Collection<? extends E> collection)
void
addNull()
void
addNulls(int index)
void
clear()
boolean
contains(@Nullable java.lang.Object o)
boolean
containsAll(@NotNull java.util.Collection<?> collection)
@NotNull java.util.BitSet
differenceBitSet(@NotNull java.lang.Iterable<? extends E> items)
@NotNull java.util.BitSet
differenceBitSet(@NotNull java.util.Iterator<? extends E> items)
boolean
equals(java.lang.Object o)
@NotNull Indexed<E>
getConcurrentModsIndexedProxy()
@NotNull Indexed<E>
getIndexedProxy()
(package private) int
getIteratorModificationCount()
int
getModificationCount()
@NotNull java.util.BitSet
getValidIndices()
E
getValue(int index)
@NotNull java.util.List<E>
getValueList()
E
getValueOrNull(int index)
int
hashCode()
static <T1> T1
ifNull(T1 o, T1 nullValue)
@NotNull java.util.BitSet
indexBitSet(@NotNull java.lang.Iterable<? extends E> items)
@NotNull ReversibleIterable<java.lang.Integer>
indexIterable()
@NotNull ReversibleIterator<java.lang.Integer>
indexIterator()
int
indexOf(@Nullable java.lang.Object element)
boolean
inHostUpdate()
boolean
isEmpty()
boolean
isSparse()
boolean
isValidIndex(int index)
@NotNull ReversibleIterable<E>
iterable()
@NotNull ReversibleIndexedIterator<E>
iterator()
@NotNull java.util.BitSet
keyDifferenceBitSet(@NotNull java.lang.Iterable<? extends java.util.Map.Entry<? extends E,?>> items)
@NotNull java.util.BitSet
keyDifferenceBitSet(@NotNull java.util.Iterator<? extends java.util.Map.Entry<? extends E,?>> items)
boolean
remove(@Nullable java.lang.Object o)
boolean
removeAll(@NotNull java.util.Collection<?> collection)
@Nullable java.lang.Object
removeHosted(@Nullable java.lang.Object o)
boolean
removeIndex(int index)
java.lang.Object
removeIndexHosted(int index)
boolean
retainAll(@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()
boolean
setValueAt(int index, E value, @Nullable java.lang.Object o)
int
size()
@NotNull java.lang.Object[]
toArray()
<T> @NotNull T[]
toArray(@NotNull T[] array)
void
validateIndex(int index)
@NotNull java.util.BitSet
valueDifferenceBitSet(@NotNull java.lang.Iterable<? extends java.util.Map.Entry<?,? extends E>> items)
@NotNull java.util.BitSet
valueDifferenceBitSet(@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()
-
-