Class SingletonMemoryView<Value>
java.lang.Object
tools.refinery.interpreter.matchers.util.SingletonMemoryView<Value>
- All Implemented Interfaces:
Iterable<Value>,IMemoryView<Value>
An immutable memory view that consists of a single non-null element with multiplicity 1.
- Since:
- 2.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsNonZero(Value value) booleancontainsNonZeroUnsafe(Object value) The set of distinct valuesbooleanintReturns the number of occurrences of the given value.intgetCountUnsafe(Object value) Returns the number of occurrences of the given value (which may be of any type).inthashCode()booleanisEmpty()iterator()intsize()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface tools.refinery.interpreter.matchers.util.IMemoryView
asMap, asStream, entriesWithMultiplicities, forEachEntryWithMultiplicities, theContainedVersionOf, theContainedVersionOfUnsafeMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
SingletonMemoryView
-
-
Method Details
-
iterator
-
getCount
Description copied from interface:IMemoryViewReturns the number of occurrences of the given value.- Specified by:
getCountin interfaceIMemoryView<Value>- Returns:
- the number of occurrences
-
getCountUnsafe
Description copied from interface:IMemoryViewReturns the number of occurrences of the given value (which may be of any type).- Specified by:
getCountUnsafein interfaceIMemoryView<Value>- Returns:
- the number of occurrences
-
containsNonZero
- Specified by:
containsNonZeroin interfaceIMemoryView<Value>- Returns:
- true if the given value is contained with a nonzero multiplicity
-
containsNonZeroUnsafe
- Specified by:
containsNonZeroUnsafein interfaceIMemoryView<Value>- Returns:
- true if the given value (which may be of any type) is contained with a nonzero multiplicity
-
size
public int size()- Specified by:
sizein interfaceIMemoryView<Value>- Returns:
- the number of distinct values
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceIMemoryView<Value>- Returns:
- iff contains at least one value with non-zero occurrences
-
distinctValues
Description copied from interface:IMemoryViewThe set of distinct values- Specified by:
distinctValuesin interfaceIMemoryView<Value>
-
equals
-
hashCode
public int hashCode() -
toString
-