Class WeakContainmentMultiMap<T>

java.lang.Object
java.util.AbstractCollection<T>
com.jozufozu.flywheel.light.WeakContainmentMultiMap<T>
All Implemented Interfaces:
Iterable<T>, Collection<T>

public class WeakContainmentMultiMap<T> extends AbstractCollection<T>
  • Constructor Details

    • WeakContainmentMultiMap

      public WeakContainmentMultiMap()
  • Method Details

    • getAndResetContainment

      public it.unimi.dsi.fastutil.longs.LongSet getAndResetContainment(T listener)
      This is a confusing function, but it maintains the internal state of the chunk/section maps.

      First, uses the reverse lookup map to remove listener from all sets in the lookup map.
      Then, clears the listeners containment set.

      Parameters:
      listener - The listener to clean up.
      Returns:
      An empty set that should be populated with the chunks/sections the listener is contained in.
    • get

      public Set<T> get(long l)
    • put

      public void put(long sectionPos, T listener)
    • remove

      public boolean remove(Object o)
      Specified by:
      remove in interface Collection<T>
      Overrides:
      remove in class AbstractCollection<T>
    • iterator

      public Iterator<T> iterator()
      Specified by:
      iterator in interface Collection<T>
      Specified by:
      iterator in interface Iterable<T>
      Specified by:
      iterator in class AbstractCollection<T>
    • size

      public int size()
      Specified by:
      size in interface Collection<T>
      Specified by:
      size in class AbstractCollection<T>