Class ClassificationBag<K,V>
- java.lang.Object
-
- com.vladsch.flexmark.util.collection.ClassificationBag<K,V>
-
public class ClassificationBag<K,V> extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description (package private) @NotNull IndexedItemBitSetMap<K,V>
bag
(package private) @Nullable CollectionHost<V>
host
private @NotNull OrderedSet<V>
items
-
Constructor Summary
Constructors Constructor Description ClassificationBag(int capacity, @NotNull java.util.function.Function<V,K> mapper)
ClassificationBag(int capacity, @NotNull java.util.function.Function<V,K> mapper, @Nullable CollectionHost<V> host)
ClassificationBag(@NotNull java.util.function.Function<V,K> mapper, @Nullable CollectionHost<V> host)
ClassificationBag(java.util.function.Function<V,K> mapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(V item)
@NotNull java.util.BitSet
categoriesBitSet(@NotNull java.util.Collection<? extends K> categories)
@NotNull java.util.BitSet
categoriesBitSet(@NotNull K... categories)
void
clear()
boolean
contains(V item)
boolean
containsCategory(K category)
int
getCategoryCount(K category)
<X> @NotNull ReversibleIterable<X>
getCategoryItems(@NotNull java.lang.Class<? extends X> xClass, @NotNull java.util.BitSet bitSet)
<X> @NotNull ReversibleIterable<X>
getCategoryItems(@NotNull java.lang.Class<? extends X> xClass, @NotNull java.util.Collection<? extends K> categories)
<X> @NotNull ReversibleIterable<X>
getCategoryItems(@NotNull java.lang.Class<? extends X> xClass, @NotNull K... categories)
<X> @NotNull ReversibleIterable<X>
getCategoryItemsReversed(@NotNull java.lang.Class<? extends X> xClass, @NotNull java.util.BitSet bitSet)
<X> @NotNull ReversibleIterable<X>
getCategoryItemsReversed(@NotNull java.lang.Class<? extends X> xClass, @NotNull java.util.Collection<? extends K> categories)
<X> @NotNull ReversibleIterable<X>
getCategoryItemsReversed(@NotNull java.lang.Class<? extends X> xClass, @NotNull K... categories)
@NotNull java.util.Map<K,java.util.BitSet>
getCategoryMap()
@Nullable java.util.BitSet
getCategorySet(K category)
@NotNull OrderedSet<V>
getItems()
int
getModificationCount()
boolean
remove(int index)
boolean
remove(V item)
-
-
-
Field Detail
-
items
@NotNull private final @NotNull OrderedSet<V> items
-
bag
@NotNull final @NotNull IndexedItemBitSetMap<K,V> bag
-
host
@Nullable final @Nullable CollectionHost<V> host
-
-
Constructor Detail
-
ClassificationBag
public ClassificationBag(@NotNull @NotNull java.util.function.Function<V,K> mapper, @Nullable @Nullable CollectionHost<V> host)
-
ClassificationBag
public ClassificationBag(int capacity, @NotNull @NotNull java.util.function.Function<V,K> mapper)
-
ClassificationBag
public ClassificationBag(int capacity, @NotNull @NotNull java.util.function.Function<V,K> mapper, @Nullable @Nullable CollectionHost<V> host)
-
-
Method Detail
-
getItems
@NotNull public @NotNull OrderedSet<V> getItems()
-
getModificationCount
public int getModificationCount()
-
add
public boolean add(@Nullable V item)
-
remove
public boolean remove(@Nullable V item)
-
remove
public boolean remove(int index)
-
contains
public boolean contains(@Nullable V item)
-
containsCategory
public boolean containsCategory(@Nullable K category)
-
getCategorySet
@Nullable public @Nullable java.util.BitSet getCategorySet(@Nullable K category)
-
getCategoryCount
public int getCategoryCount(@Nullable K category)
-
getCategoryMap
@NotNull public @NotNull java.util.Map<K,java.util.BitSet> getCategoryMap()
-
clear
public void clear()
-
getCategoryItems
@SafeVarargs @NotNull public final <X> @NotNull ReversibleIterable<X> getCategoryItems(@NotNull @NotNull java.lang.Class<? extends X> xClass, @NotNull @NotNull K... categories)
-
getCategoryItems
@NotNull public final <X> @NotNull ReversibleIterable<X> getCategoryItems(@NotNull @NotNull java.lang.Class<? extends X> xClass, @NotNull @NotNull java.util.Collection<? extends K> categories)
-
getCategoryItems
@NotNull public final <X> @NotNull ReversibleIterable<X> getCategoryItems(@NotNull @NotNull java.lang.Class<? extends X> xClass, @NotNull @NotNull java.util.BitSet bitSet)
-
getCategoryItemsReversed
@SafeVarargs @NotNull public final <X> @NotNull ReversibleIterable<X> getCategoryItemsReversed(@NotNull @NotNull java.lang.Class<? extends X> xClass, @NotNull @NotNull K... categories)
-
getCategoryItemsReversed
@NotNull public final <X> @NotNull ReversibleIterable<X> getCategoryItemsReversed(@NotNull @NotNull java.lang.Class<? extends X> xClass, @NotNull @NotNull java.util.Collection<? extends K> categories)
-
getCategoryItemsReversed
@NotNull public final <X> @NotNull ReversibleIterable<X> getCategoryItemsReversed(@NotNull @NotNull java.lang.Class<? extends X> xClass, @NotNull @NotNull java.util.BitSet bitSet)
-
categoriesBitSet
@SafeVarargs @NotNull public final @NotNull java.util.BitSet categoriesBitSet(@NotNull @NotNull K... categories)
-
categoriesBitSet
@NotNull public final @NotNull java.util.BitSet categoriesBitSet(@NotNull @NotNull java.util.Collection<? extends K> categories)
-
-