Class EclipseCollectionsLongSetMemory

java.lang.Object
org.eclipse.collections.impl.primitive.AbstractLongIterable
org.eclipse.collections.impl.set.primitive.AbstractLongSet
org.eclipse.collections.impl.set.mutable.primitive.LongHashSet
tools.refinery.interpreter.matchers.util.EclipseCollectionsLongSetMemory
All Implemented Interfaces:
Externalizable, Serializable, Iterable<Long>, org.eclipse.collections.api.collection.primitive.MutableLongCollection, org.eclipse.collections.api.LongIterable, org.eclipse.collections.api.PrimitiveIterable, org.eclipse.collections.api.set.primitive.LongSet, org.eclipse.collections.api.set.primitive.MutableLongSet, Clearable, IMemory<Long>, IMemoryView<Long>, ISetMemory<Long>

public class EclipseCollectionsLongSetMemory extends org.eclipse.collections.impl.set.mutable.primitive.LongHashSet implements ISetMemory<Long>
Since:
2.0
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Helper that presents a primitive collection as a Set view
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    addOne(Long value)
    Adds one value occurrence 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
     
    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
     
     
    static Iterator<Long>
    iteratorOf(org.eclipse.collections.api.LongIterable wrapped)
    Helper for iterating a LongIterable
    boolean
    removeOne(Long value)
    Removes one occurrence of the given value from the memory.
    boolean
    Removes one occurrence of the given value from the memory, if possible.

    Methods inherited from class org.eclipse.collections.impl.set.mutable.primitive.LongHashSet

    add, addAll, addAll, allocateTable, allSatisfy, anySatisfy, appendString, asSynchronized, asUnmodifiable, chunk, clear, collect, collect, compact, contains, count, detectIfNone, each, freeze, injectInto, longIterator, max, min, newEmpty, newSet, newSetWith, readExternal, reject, reject, remove, removeAll, removeAll, retainAll, retainAll, select, select, size, sum, toArray, toArray, toImmutable, with, withAll, without, withoutAll, writeExternal

    Methods inherited from class org.eclipse.collections.impl.set.primitive.AbstractLongSet

    cartesianProduct

    Methods inherited from class org.eclipse.collections.impl.primitive.AbstractLongIterable

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

    Methods inherited from class java.lang.Object

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

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

    clear

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

    asMap, asStream, entriesWithMultiplicities, size, theContainedVersionOf, theContainedVersionOfUnsafe

    Methods inherited from interface tools.refinery.interpreter.matchers.util.ISetMemory

    forEachEntryWithMultiplicities

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator

    Methods inherited from interface org.eclipse.collections.api.LongIterable

    asLazy, average, averageIfEmpty, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, flatCollect, forEach, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, maxIfEmpty, median, medianIfEmpty, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedList, toSortedList, toSortedListBy, toSortedListBy

    Methods inherited from interface org.eclipse.collections.api.set.primitive.LongSet

    cartesianProduct, isProperSubsetOf, isSubsetOf, tap

    Methods inherited from interface org.eclipse.collections.api.collection.primitive.MutableLongCollection

    removeIf

    Methods inherited from interface org.eclipse.collections.api.set.primitive.MutableLongSet

    difference, intersect, symmetricDifference, tap, union

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

    appendString, appendString, makeString, makeString, makeString, notEmpty, toString
  • Constructor Details

    • EclipseCollectionsLongSetMemory

      public EclipseCollectionsLongSetMemory()
  • Method Details

    • addOne

      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

      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

      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>
      Specified by:
      removeOne in interface ISetMemory<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

      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
    • clearAllOf

      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

      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

      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

      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

      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

      public Iterator<Long> iterator()
      Specified by:
      iterator in interface Iterable<Long>
    • distinctValues

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

      public boolean isEmpty()
      Specified by:
      isEmpty in interface IMemoryView<Long>
      Specified by:
      isEmpty in interface org.eclipse.collections.api.PrimitiveIterable
      Returns:
      iff contains at least one value with non-zero occurrences
    • iteratorOf

      public static Iterator<Long> iteratorOf(org.eclipse.collections.api.LongIterable wrapped)
      Helper for iterating a LongIterable
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface org.eclipse.collections.api.set.primitive.LongSet
      Overrides:
      hashCode in class org.eclipse.collections.impl.set.mutable.primitive.LongHashSet
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface org.eclipse.collections.api.set.primitive.LongSet
      Overrides:
      equals in class org.eclipse.collections.impl.set.primitive.AbstractLongSet