Class InsertableLinkedOpenCustomHashSet<T>

java.lang.Object
java.util.AbstractCollection<T>
it.unimi.dsi.fastutil.objects.AbstractObjectCollection<T>
it.unimi.dsi.fastutil.objects.AbstractObjectSet<T>
it.unimi.dsi.fastutil.objects.AbstractObjectSortedSet<T>
it.unimi.dsi.fastutil.objects.ObjectLinkedOpenCustomHashSet<T>
net.neoforged.neoforge.common.util.InsertableLinkedOpenCustomHashSet<T>
All Implemented Interfaces:
it.unimi.dsi.fastutil.Hash, it.unimi.dsi.fastutil.objects.ObjectBidirectionalIterable<T>, it.unimi.dsi.fastutil.objects.ObjectCollection<T>, it.unimi.dsi.fastutil.objects.ObjectIterable<T>, it.unimi.dsi.fastutil.objects.ObjectSet<T>, it.unimi.dsi.fastutil.objects.ObjectSortedSet<T>, Serializable, Cloneable, Iterable<T>, Collection<T>, SequencedCollection<T>, SequencedSet<T>, Set<T>, SortedSet<T>

public class InsertableLinkedOpenCustomHashSet<T> extends it.unimi.dsi.fastutil.objects.ObjectLinkedOpenCustomHashSet<T>
Special linked hash set that allow changing the order of its entries and is strict to throw if attempting to add an entry that already exists. Requires a strategy for the hashing behavior. Use BasicStrategy.BASIC or IdentityStrategy.IDENTITY if no special hashing needed.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface it.unimi.dsi.fastutil.Hash

    it.unimi.dsi.fastutil.Hash.Strategy<K>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final long
    The number of bits which take up the space for the previous or next position.
    private static final long
    The bitmask for the next element's position.
    private static final long
    The bitmask for the previous element's position.

    Fields inherited from class it.unimi.dsi.fastutil.objects.ObjectLinkedOpenCustomHashSet

    containsNull, f, first, key, last, link, mask, maxFill, minN, n, size, strategy

    Fields inherited from interface it.unimi.dsi.fastutil.Hash

    DEFAULT_GROWTH_FACTOR, DEFAULT_INITIAL_SIZE, DEFAULT_LOAD_FACTOR, FAST_LOAD_FACTOR, FREE, OCCUPIED, PRIMES, REMOVED, VERY_FAST_LOAD_FACTOR
  • Constructor Summary

    Constructors
    Constructor
    Description
    InsertableLinkedOpenCustomHashSet(it.unimi.dsi.fastutil.Hash.Strategy<? super T> strategy)
    Constructs a new InsertableLinkedOpenCustomHashSet with the given Hash.Strategy.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    addAfter(T insertAfter, T element)
    This method will attempt to add element after the given element insertAfter in the set.
    boolean
    addBefore(T insertBefore, T element)
    This method will attempt to add element before the given element insertBefore in the set.
    void
    addFirst(T element)
     
    void
    addLast(T element)
     
    private int
    getPos(T existingElement)
    Requires that existingElement exists in the set already.

    Methods inherited from class it.unimi.dsi.fastutil.objects.ObjectLinkedOpenCustomHashSet

    add, addAll, addAndMoveToFirst, addAndMoveToLast, addOrGet, clear, clone, comparator, contains, ensureCapacity, first, fixPointers, fixPointers, forEach, get, hashCode, headSet, isEmpty, iterator, iterator, last, rehash, remove, removeFirst, removeLast, shiftKeys, size, spliterator, strategy, subSet, tailSet, trim, trim

    Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractObjectSet

    equals

    Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractObjectCollection

    toString

    Methods inherited from class java.util.AbstractCollection

    containsAll, removeAll, retainAll, toArray, toArray

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.util.Collection

    parallelStream, removeIf, stream, toArray

    Methods inherited from interface java.util.Set

    containsAll, equals, removeAll, retainAll, toArray, toArray

    Methods inherited from interface java.util.SortedSet

    getFirst, getLast, reversed
  • Field Details

  • Constructor Details

    • InsertableLinkedOpenCustomHashSet

      public InsertableLinkedOpenCustomHashSet()
    • InsertableLinkedOpenCustomHashSet

      public InsertableLinkedOpenCustomHashSet(it.unimi.dsi.fastutil.Hash.Strategy<? super T> strategy)
      Constructs a new InsertableLinkedOpenCustomHashSet with the given Hash.Strategy.
      Parameters:
      strategy - The strategy to use for adding and getting elements from the set.
  • Method Details

    • addAfter

      public boolean addAfter(T insertAfter, T element)
      This method will attempt to add element after the given element insertAfter in the set. If an element matching insertAfter cannot be found with this set's Hash.Strategy, then element will be added in insertion order. If {#code element} already exists in the set, then the set is not modified.
      Parameters:
      insertAfter - The element to insert element after.
      element - The element to add into this set.
      Returns:
      true if the element was added to the set.
    • addBefore

      public boolean addBefore(T insertBefore, T element)
      This method will attempt to add element before the given element insertBefore in the set. If an element matching insertBefore cannot be found with this set's Hash.Strategy, then element will be added in insertion order. If {#code element} already exists in the set, then the set is not modified.
      Parameters:
      insertBefore - The element to insert element before.
      element - The element to add into this set.
      Returns:
      true if the element was added to the set.
    • addFirst

      public void addFirst(T element)
    • addLast

      public void addLast(T element)
    • getPos

      private int getPos(T existingElement)
      Requires that existingElement exists in the set already.