public class MapBackedMemoryView<T> extends java.lang.Object implements IMemoryView<T>
IMemoryView.| Modifier | Constructor and Description |
|---|---|
protected |
MapBackedMemoryView(java.util.Map<T,java.lang.Integer> wrapped) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsNonZero(T value) |
boolean |
containsNonZeroUnsafe(java.lang.Object value) |
java.util.Set<T> |
distinctValues()
The set of distinct values
|
java.lang.Iterable<java.util.Map.Entry<T,java.lang.Integer>> |
entriesWithMultiplicities() |
boolean |
equals(java.lang.Object obj) |
void |
forEachEntryWithMultiplicities(java.util.function.BiConsumer<T,java.lang.Integer> entryConsumer)
Process contained values with their multiplicities
|
int |
getCount(T value)
Returns the number of occurrences of the given value.
|
int |
getCountUnsafe(java.lang.Object value)
Returns the number of occurrences of the given value (which may be of any type).
|
int |
hashCode() |
boolean |
isEmpty() |
java.util.Iterator<T> |
iterator() |
int |
size() |
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitasMap, asStream, equals, fromMap, hashCode, theContainedVersionOf, theContainedVersionOfUnsafeprotected MapBackedMemoryView(java.util.Map<T,java.lang.Integer> wrapped)
wrapped - an equivalent map from contained objects to multiplicitiespublic java.util.Iterator<T> iterator()
iterator in interface java.lang.Iterable<T>public int getCount(T value)
IMemoryViewgetCount in interface IMemoryView<T>public int getCountUnsafe(java.lang.Object value)
IMemoryViewgetCountUnsafe in interface IMemoryView<T>public boolean containsNonZero(T value)
containsNonZero in interface IMemoryView<T>public boolean containsNonZeroUnsafe(java.lang.Object value)
containsNonZeroUnsafe in interface IMemoryView<T>public int size()
size in interface IMemoryView<T>public boolean isEmpty()
isEmpty in interface IMemoryView<T>public java.util.Set<T> distinctValues()
IMemoryViewdistinctValues in interface IMemoryView<T>public void forEachEntryWithMultiplicities(java.util.function.BiConsumer<T,java.lang.Integer> entryConsumer)
IMemoryViewforEachEntryWithMultiplicities in interface IMemoryView<T>public java.lang.Iterable<java.util.Map.Entry<T,java.lang.Integer>> entriesWithMultiplicities()
entriesWithMultiplicities in interface IMemoryView<T>public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object