Class EclipseCollectionsLongMultiset

java.lang.Object
org.eclipse.collections.impl.primitive.AbstractIntIterable
org.eclipse.collections.impl.map.mutable.primitive.AbstractMutableIntValuesMap
org.eclipse.collections.impl.map.mutable.primitive.LongIntHashMap
tools.refinery.interpreter.matchers.util.EclipseCollectionsLongMultiset
All Implemented Interfaces:
Externalizable, Serializable, Iterable<Long>, org.eclipse.collections.api.IntIterable, org.eclipse.collections.api.map.primitive.IntValuesMap, org.eclipse.collections.api.map.primitive.LongIntMap, org.eclipse.collections.api.map.primitive.MutableIntValuesMap, org.eclipse.collections.api.map.primitive.MutableLongIntMap, org.eclipse.collections.api.PrimitiveIterable, org.eclipse.collections.impl.map.mutable.primitive.MutableLongKeysMap, org.eclipse.collections.impl.map.primitive.LongKeysMap, Clearable, IMemory<Long>, IMemoryView<Long>, IMultiset<Long>

public class EclipseCollectionsLongMultiset extends org.eclipse.collections.impl.map.mutable.primitive.LongIntHashMap implements IMultiset<Long>
Since:
2.0

TODO refactor common methods with EclipseCollectionsMultiset

TODO refactor into LongBagMemory etc.

See Also:
  • Nested Class Summary Link icon

    Nested classes/interfaces inherited from class org.eclipse.collections.impl.map.mutable.primitive.AbstractMutableIntValuesMap Link icon

    org.eclipse.collections.impl.map.mutable.primitive.AbstractMutableIntValuesMap.AbstractIntValuesCollection, org.eclipse.collections.impl.map.mutable.primitive.AbstractMutableIntValuesMap.SentinelValues
  • Constructor Summary Link icon

    Constructors
    Constructor
    Description
     
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    boolean
    addOne(Long value)
    Adds one value occurrence to the memory.
    boolean
    addPositive(Long value, int count)
    Adds the given number of occurrences to the memory.
    boolean
    addSigned(Long value, int count)
    Adds the given number of occurrences to the memory.
    void
    Removes all occurrences of the given value from the memory.
    boolean
     
    boolean
     
    The set of distinct values
    boolean
     
    void
    Process contained values with their multiplicities
    int
    getCount(Long value)
    Returns the number of occurrences of the given value.
    int
    Returns the number of occurrences of the given value (which may be of any type).
    int
     
     
    boolean
    removeOne(Long value)
    Removes one occurrence of the given value from the memory.
    protected boolean
    removeOneInternal(Long value, boolean throwIfImpossible)
     
    boolean
    Removes one occurrence of the given value from the memory, if possible.

    Methods inherited from class org.eclipse.collections.impl.map.mutable.primitive.LongIntHashMap Link icon

    addToValue, allocateTable, asSynchronized, asUnmodifiable, clear, compact, containsKey, flipUniqueValues, forEachKey, forEachKeyValue, get, getAndPut, getEmptyValue, getIfAbsent, getIfAbsentPut, getIfAbsentPut, getIfAbsentPutWith, getIfAbsentPutWithKey, getOccupiedWithData, getOrThrow, getSentinelValues, getTableSize, getValueAtIndex, injectInto, intIterator, isNonSentinelAtIndex, keySet, keysView, keyValuesView, newWithKeysValues, newWithKeysValues, newWithKeysValues, newWithKeysValues, put, putAll, readExternal, reject, remove, removeKey, removeKeyIfAbsent, select, setSentinelValuesNull, toImmutable, toString, updateValue, updateValues, values, withKeysValues, withKeysValues, withKeysValues, withKeyValue, withoutAllKeys, withoutKey, writeExternal

    Methods inherited from class org.eclipse.collections.impl.map.mutable.primitive.AbstractMutableIntValuesMap Link icon

    addEmptyKeyValue, addRemovedKeyValue, allSatisfy, anySatisfy, appendString, chunk, collect, contains, containsAll, containsValue, count, detectIfNone, each, forEachValue, isEmpty, max, min, notEmpty, reject, removeEmptyKey, removeRemovedKey, select, size, sum, toArray, toArray

    Methods inherited from class org.eclipse.collections.impl.primitive.AbstractIntIterable Link icon

    asLazy, average, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList

    Methods inherited from class java.lang.Object Link icon

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

    Methods inherited from interface tools.refinery.interpreter.matchers.util.IMemory Link icon

    clear

    Methods inherited from interface tools.refinery.interpreter.matchers.util.IMemoryView Link icon

    asMap, asStream, entriesWithMultiplicities, isEmpty, size, theContainedVersionOf, theContainedVersionOfUnsafe

    Methods inherited from interface org.eclipse.collections.api.IntIterable Link icon

    allSatisfy, anySatisfy, asLazy, average, averageIfEmpty, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, flatCollect, forEach, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, max, maxIfEmpty, median, medianIfEmpty, min, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, reject, select, sum, summaryStatistics, toArray, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toSortedList, toSortedListBy, toSortedListBy

    Methods inherited from interface org.eclipse.collections.api.map.primitive.IntValuesMap Link icon

    containsValue, forEachValue, tap

    Methods inherited from interface java.lang.Iterable Link icon

    forEach, spliterator

    Methods inherited from interface org.eclipse.collections.api.map.primitive.LongIntMap Link icon

    injectIntoKeyValue

    Methods inherited from interface org.eclipse.collections.impl.map.primitive.LongKeysMap Link icon

    isEmpty, notEmpty, size

    Methods inherited from interface org.eclipse.collections.api.map.primitive.MutableIntValuesMap Link icon

    collect, reject, select

    Methods inherited from interface org.eclipse.collections.api.map.primitive.MutableLongIntMap Link icon

    putPair, withAllKeyValues

    Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable Link icon

    appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size
  • Constructor Details Link icon

    • EclipseCollectionsLongMultiset Link icon

      public EclipseCollectionsLongMultiset()
  • Method Details Link icon

    • addOne Link icon

      public boolean addOne(Long value)
      Description copied from interface: IMemory
      Adds one value occurrence to the memory.
      Specified by:
      addOne in interface IMemory<Long>
      Returns:
      true if the tuple was not present before in the memory, or (in case of IDeltaBag) is no longer present in the memory
    • addSigned Link icon

      public boolean addSigned(Long value, int count)
      Description copied from interface: IMemory
      Adds the given number of occurrences to the memory. The count value may or may not be negative.

      Precondition if IMultiset: at least the given amount of occurrences exist, if count is negative.

      Precondition if ISetMemory: count is +1 or -1, the latter is only allowed if the set contains the value.

      Specified by:
      addSigned in interface IMemory<Long>
      Parameters:
      count - the number of occurrences
      Returns:
      true if the tuple was not present before in the memory, or is no longer present in the memory
    • removeOne Link icon

      public boolean removeOne(Long value)
      Description copied from interface: IMemory
      Removes one occurrence of the given value from the memory.

      Precondition if IMultiset or ISetMemory: the value must have a positive amount of occurrences in the memory.

      Specified by:
      removeOne in interface IMemory<Long>
      Returns:
      true if this was the the last occurrence of the value, or (in case of IDeltaBag) is the first negative occurrence of the value
    • removeOneOrNop Link icon

      public boolean removeOneOrNop(Long value)
      Description copied from interface: IMemory
      Removes one occurrence of the given value from the memory, if possible.

      Memory is unchanged and false is returned if IMultiset or ISetMemory and value had no occurrences in the memory

      Specified by:
      removeOneOrNop in interface IMemory<Long>
      Returns:
      true if this was the the last occurrence of the value, or (in case of IDeltaBag) is the first negative occurrence of the value
      Since:
      2.3
    • removeOneInternal Link icon

      protected boolean removeOneInternal(Long value, boolean throwIfImpossible)
      Since:
      2.3
    • clearAllOf Link icon

      public void clearAllOf(Long value)
      Description copied from interface: IMemory
      Removes all occurrences of the given value from the memory.
      Specified by:
      clearAllOf in interface IMemory<Long>
    • getCount Link icon

      public int getCount(Long value)
      Description copied from interface: IMemoryView
      Returns the number of occurrences of the given value.
      Specified by:
      getCount in interface IMemoryView<Long>
      Returns:
      the number of occurrences
    • getCountUnsafe Link icon

      public int getCountUnsafe(Object value)
      Description copied from interface: IMemoryView
      Returns the number of occurrences of the given value (which may be of any type).
      Specified by:
      getCountUnsafe in interface IMemoryView<Long>
      Returns:
      the number of occurrences
    • containsNonZero Link icon

      public boolean containsNonZero(Long value)
      Specified by:
      containsNonZero in interface IMemoryView<Long>
      Returns:
      true if the given value is contained with a nonzero multiplicity
    • containsNonZeroUnsafe Link icon

      public boolean containsNonZeroUnsafe(Object value)
      Specified by:
      containsNonZeroUnsafe in interface IMemoryView<Long>
      Returns:
      true if the given value (which may be of any type) is contained with a nonzero multiplicity
    • iterator Link icon

      public Iterator<Long> iterator()
      Specified by:
      iterator in interface Iterable<Long>
    • addPositive Link icon

      public boolean addPositive(Long value, int count)
      Description copied from interface: IMultiset
      Adds the given number of occurrences to the memory. The count value must be a positive number.
      Specified by:
      addPositive in interface IMultiset<Long>
      Parameters:
      count - the number of occurrences
      Returns:
      true if the tuple was not present before in the memory
    • distinctValues Link icon

      public Set<Long> distinctValues()
      Description copied from interface: IMemoryView
      The set of distinct values
      Specified by:
      distinctValues in interface IMemoryView<Long>
    • forEachEntryWithMultiplicities Link icon

      public void forEachEntryWithMultiplicities(BiConsumer<Long,Integer> entryConsumer)
      Description copied from interface: IMemoryView
      Process contained values with their multiplicities
      Specified by:
      forEachEntryWithMultiplicities in interface IMemoryView<Long>
    • hashCode Link icon

      public int hashCode()
      Specified by:
      hashCode in interface org.eclipse.collections.api.map.primitive.LongIntMap
      Overrides:
      hashCode in class org.eclipse.collections.impl.map.mutable.primitive.LongIntHashMap
    • equals Link icon

      public boolean equals(Object obj)
      Specified by:
      equals in interface org.eclipse.collections.api.map.primitive.LongIntMap
      Overrides:
      equals in class org.eclipse.collections.impl.map.mutable.primitive.LongIntHashMap