Package one.microstream.collections
Class EmptyTable<K,V>
java.lang.Object
one.microstream.collections.EmptyTable<K,V>
- All Implemented Interfaces:
Iterable<KeyValue<K,V>>,CapacityCarrying,ExtendedCollection<KeyValue<K,V>>,ExtendedMap<K,V>,ExtendedSequence<KeyValue<K,V>>,Sized,XGettingCollection<KeyValue<K,V>>,XGettingEnum<KeyValue<K,V>>,XGettingMap<K,V>,XGettingSequence<KeyValue<K,V>>,XGettingSet<KeyValue<K,V>>,XGettingTable<K,V>,XImmutableCollection<KeyValue<K,V>>,XImmutableEnum<KeyValue<K,V>>,XImmutableMap<K,V>,XImmutableSequence<KeyValue<K,V>>,XImmutableSet<KeyValue<K,V>>,XImmutableTable<K,V>,XIndexIterable<KeyValue<K,V>>,XIterable<KeyValue<K,V>>,XJoinable<KeyValue<K,V>>,ThreadSafe,HashImmutable,Copyable,Immutable
public final class EmptyTable<K,V> extends Object implements XImmutableTable<K,V>
-
Nested Class Summary
Nested classes/interfaces inherited from interface one.microstream.collections.interfaces.ExtendedCollection
ExtendedCollection.Creator<E,C extends ExtendedCollection<E>>Nested classes/interfaces inherited from interface one.microstream.collections.types.XGettingCollection
XGettingCollection.Creator<E>Nested classes/interfaces inherited from interface one.microstream.collections.types.XGettingEnum
XGettingEnum.Creator<E>Nested classes/interfaces inherited from interface one.microstream.collections.types.XGettingMap
XGettingMap.Creator<K,V>Nested classes/interfaces inherited from interface one.microstream.collections.types.XGettingSequence
XGettingSequence.Factory<E>Nested classes/interfaces inherited from interface one.microstream.collections.types.XGettingSet
XGettingSet.Creator<E>Nested classes/interfaces inherited from interface one.microstream.collections.types.XImmutableEnum
XImmutableEnum.Factory<E>Nested classes/interfaces inherited from interface one.microstream.collections.types.XImmutableSet
XImmutableSet.Factory<E>Nested classes/interfaces inherited from interface one.microstream.collections.types.XImmutableTable
XImmutableTable.Bridge<K,V>, XImmutableTable.EntriesBridge<K,V>, XImmutableTable.Satellite<K,V>Nested classes/interfaces inherited from interface one.microstream.collections.types.XIterable
XIterable.Executor<E> -
Constructor Summary
Constructors Constructor Description EmptyTable() -
Method Summary
Modifier and Type Method Description booleanapplies(Predicate<? super KeyValue<K,V>> predicate)KeyValue<K,V>at(long index)booleancontains(KeyValue<K,V> element)booleancontainsAll(XGettingCollection<? extends KeyValue<K,V>> elements)booleancontainsId(KeyValue<K,V> element)Special version of contains() that guarantees to use identity comparison (" == ") when searching for the given element regardless of the collection's internal logic.
This method has the same behavior asXGettingCollection.containsSearched(Predicate)with aPredicateimplementation that checks for object identity.booleancontainsSearched(Predicate<? super KeyValue<K,V>> predicate)EmptyTable<K,V>copy()Creates a true copy of this collection which references the same elements as this collection does at the time the method is called.<T extends Consumer<? super KeyValue<K, V>>>
TcopySelection(T target, long... indices)<T extends Consumer<? super KeyValue<K, V>>>
TcopyTo(T target)longcount(KeyValue<K,V> element)longcountBy(Predicate<? super KeyValue<K,V>> predicate)<T extends Consumer<? super KeyValue<K, V>>>
Tdistinct(T target)<T extends Consumer<? super KeyValue<K, V>>>
Tdistinct(T target, Equalator<? super KeyValue<K,V>> equalator)Equalator<? super KeyValue<K,V>>equality()booleanequals(XGettingCollection<? extends KeyValue<K,V>> samples, Equalator<? super KeyValue<K,V>> equalator)Returnstrueif the passed collection is of the same type as this collection andthis.equalsContent(list, equalator)yieldstrue.booleanequalsContent(XGettingCollection<? extends KeyValue<K,V>> samples, Equalator<? super KeyValue<K,V>> equalator)Returnstrueif all elements of this list and the passed list are sequentially equal as defined by the passed equalator.<T extends Consumer<? super KeyValue<K, V>>>
Texcept(XGettingCollection<? extends KeyValue<K,V>> other, Equalator<? super KeyValue<K,V>> equalator, T target)<T extends Consumer<? super KeyValue<K, V>>>
TfilterTo(T target, Predicate<? super KeyValue<K,V>> predicate)KeyValue<K,V>first()KeyValue<K,V>get()Gets one element from the collection.Vget(K key)booleanhasVolatileElements()Tells if this collection contains volatile elements.
An element is volatile, if it can become no longer reachable by the collection without being removed from the collection.XImmutableTable<K,V>immure()Provides an instance of an immutable collection type with equal behavior and data as this instance.longindexBy(Predicate<? super KeyValue<K,V>> predicate)longindexOf(KeyValue<K,V> element)<T extends Consumer<? super KeyValue<K, V>>>
Tintersect(XGettingCollection<? extends KeyValue<K,V>> other, Equalator<? super KeyValue<K,V>> equalator, T target)booleanisEmpty()booleanisFull()Returns true if the current capacity cannot be increased any more.booleanisSorted(Comparator<? super KeyValue<K,V>> comparator)<P extends Consumer<? super KeyValue<K, V>>>
Piterate(P procedure)<P extends IndexedAcceptor<? super KeyValue<K, V>>>
PiterateIndexed(P procedure)Iterator<KeyValue<K,V>>iterator()<A> Ajoin(BiConsumer<? super KeyValue<K,V>,? super A> joiner, A aggregate)XImmutableTable.Keys<K,V>keys()KeyValue<K,V>last()longlastIndexBy(Predicate<? super KeyValue<K,V>> predicate)longlastIndexOf(KeyValue<K,V> element)KeyValue<K,V>lookup(K key)KeyValue<K,V>max(Comparator<? super KeyValue<K,V>> comparator)longmaximumCapacity()Returns the maximum amount of elements this carrier instance can contain.
The actual value may be depend on the configuration of the concrete instance or may depend only on the implementation of the carrier (meaning it is constant for all instances of the implementation, e.g.longmaxIndex(Comparator<? super KeyValue<K,V>> comparator)KeyValue<K,V>min(Comparator<? super KeyValue<K,V>> comparator)longminIndex(Comparator<? super KeyValue<K,V>> comparator)booleannullAllowed()booleannullContained()booleannullKeyAllowed()booleannullValuesAllowed()XImmutableTable.EntriesBridge<K,V>old()XImmutableTable.Bridge<K,V>oldMap()KeyValue<K,V>peek()KeyValue<K,V>poll()<C extends Consumer<? super V>>
Cquery(XIterable<? extends K> keys, C collector)XGettingEnum<KeyValue<K,V>>range(long lowIndex, long highIndex)longremainingCapacity()Returns the amount of elements this carrier instance can collect before reaching its maximimum capacity.longscan(Predicate<? super KeyValue<K,V>> predicate)Iterates through the collection and returns the index of the last element that the passedPredicateapplied to ("scanning").KeyValue<K,V>search(Predicate<? super KeyValue<K,V>> predicate)VsearchValue(Predicate<? super K> keyPredicate)KeyValue<K,V>seek(KeyValue<K,V> sample)Returns the first contained element matching the passed sample as defined by the collection's equality logic or null, if no fitting element is contained.longsize()Object[]toArray()KeyValue<K,V>[]toArray(Class<KeyValue<K,V>> type)XImmutableEnum<KeyValue<K,V>>toReversed()<T extends Consumer<? super KeyValue<K, V>>>
Tunion(XGettingCollection<? extends KeyValue<K,V>> other, Equalator<? super KeyValue<K,V>> equalator, T target)XImmutableTable.Values<K,V>values()EmptyTable<K,V>view()XGettingEnum<KeyValue<K,V>>view(long lowIndex, long highIndex)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface one.microstream.collections.types.XGettingCollection
equals, hashCode, intSize
-
Constructor Details
-
EmptyTable
public EmptyTable()
-
-
Method Details
-
get
- Specified by:
getin interfaceXGettingMap<K,V>- Specified by:
getin interfaceXImmutableMap<K,V>- Specified by:
getin interfaceXImmutableTable<K,V>
-
lookup
- Specified by:
lookupin interfaceXGettingMap<K,V>
-
searchValue
- Specified by:
searchValuein interfaceXGettingMap<K,V>- Specified by:
searchValuein interfaceXImmutableMap<K,V>- Specified by:
searchValuein interfaceXImmutableTable<K,V>
-
query
- Specified by:
queryin interfaceXGettingMap<K,V>
-
copy
Description copied from interface:XGettingCollectionCreates a true copy of this collection which references the same elements as this collection does at the time the method is called. The elements themselves are NOT copied (no deep copying).
The type of the returned set is the same as of this list if possible.- Specified by:
copyin interfaceCopyable- Specified by:
copyin interfaceXGettingCollection<K>- Specified by:
copyin interfaceXGettingEnum<K>- Specified by:
copyin interfaceXGettingMap<K,V>- Specified by:
copyin interfaceXGettingSequence<K>- Specified by:
copyin interfaceXGettingSet<K>- Specified by:
copyin interfaceXGettingTable<K,V>- Specified by:
copyin interfaceXImmutableCollection<K>- Specified by:
copyin interfaceXImmutableEnum<K>- Specified by:
copyin interfaceXImmutableMap<K,V>- Specified by:
copyin interfaceXImmutableSequence<K>- Specified by:
copyin interfaceXImmutableSet<K>- Specified by:
copyin interfaceXImmutableTable<K,V>- Returns:
- a copy of this list
-
immure
Description copied from interface:XImmutableTableProvides an instance of an immutable collection type with equal behavior and data as this instance.If this instance already is of an immutable collection type, it returns itself.
- Specified by:
immurein interfaceXGettingCollection<K>- Specified by:
immurein interfaceXGettingEnum<K>- Specified by:
immurein interfaceXGettingMap<K,V>- Specified by:
immurein interfaceXGettingSequence<K>- Specified by:
immurein interfaceXGettingSet<K>- Specified by:
immurein interfaceXGettingTable<K,V>- Specified by:
immurein interfaceXImmutableCollection<K>- Specified by:
immurein interfaceXImmutableEnum<K>- Specified by:
immurein interfaceXImmutableMap<K,V>- Specified by:
immurein interfaceXImmutableSequence<K>- Specified by:
immurein interfaceXImmutableSet<K>- Specified by:
immurein interfaceXImmutableTable<K,V>- Returns:
- an immutable copy of this collection instance.
- See Also:
XImmutableCollection.copy()
-
nullKeyAllowed
public final boolean nullKeyAllowed()- Specified by:
nullKeyAllowedin interfaceXGettingMap<K,V>- Specified by:
nullKeyAllowedin interfaceXImmutableMap<K,V>- Specified by:
nullKeyAllowedin interfaceXImmutableTable<K,V>
-
nullValuesAllowed
public final boolean nullValuesAllowed()- Specified by:
nullValuesAllowedin interfaceXGettingMap<K,V>- Specified by:
nullValuesAllowedin interfaceXImmutableMap<K,V>- Specified by:
nullValuesAllowedin interfaceXImmutableTable<K,V>
-
maximumCapacity
public final long maximumCapacity()Description copied from interface:CapacityCarryingReturns the maximum amount of elements this carrier instance can contain.
The actual value may be depend on the configuration of the concrete instance or may depend only on the implementation of the carrier (meaning it is constant for all instances of the implementation, e.g.Integer.MAX_VALUE)- Specified by:
maximumCapacityin interfaceCapacityCarrying- Returns:
- the maximum amount of elements this carrier instance can contain.
-
remainingCapacity
public final long remainingCapacity()Description copied from interface:CapacityCarryingReturns the amount of elements this carrier instance can collect before reaching its maximimum capacity.- Specified by:
remainingCapacityin interfaceCapacityCarrying
-
isFull
public final boolean isFull()Description copied from interface:CapacityCarryingReturns true if the current capacity cannot be increased any more.- Specified by:
isFullin interfaceCapacityCarrying
-
size
public final long size()- Specified by:
sizein interfaceSized- Specified by:
sizein interfaceXGettingCollection<K>
-
isEmpty
public final boolean isEmpty() -
hasVolatileElements
public final boolean hasVolatileElements()Description copied from interface:XGettingCollectionTells if this collection contains volatile elements.
An element is volatile, if it can become no longer reachable by the collection without being removed from the collection. Examples areWeakReferenceofSoftReferenceor implementations of collection entries that remove the element contained in an entry by some means outside the collection.
Note thatWeakReferenceinstances that are added to a a simple (non-volatile) implementation of a collection do NOT make the collection volatile, as the elements themselves (the reference instances) are still strongly referenced.- Specified by:
hasVolatileElementsin interfaceExtendedCollection<K>- Specified by:
hasVolatileElementsin interfaceXGettingCollection<K>- Returns:
trueif the collection contains volatile elements.
-
nullAllowed
public final boolean nullAllowed()- Specified by:
nullAllowedin interfaceExtendedCollection<K>
-
view
- Specified by:
viewin interfaceXGettingCollection<K>- Specified by:
viewin interfaceXGettingEnum<K>- Specified by:
viewin interfaceXGettingMap<K,V>- Specified by:
viewin interfaceXGettingSequence<K>- Specified by:
viewin interfaceXGettingTable<K,V>
-
old
- Specified by:
oldin interfaceXGettingCollection<K>- Specified by:
oldin interfaceXGettingMap<K,V>- Specified by:
oldin interfaceXGettingTable<K,V>- Specified by:
oldin interfaceXImmutableMap<K,V>- Specified by:
oldin interfaceXImmutableTable<K,V>
-
oldMap
- Specified by:
oldMapin interfaceXGettingMap<K,V>- Specified by:
oldMapin interfaceXGettingTable<K,V>- Specified by:
oldMapin interfaceXImmutableMap<K,V>- Specified by:
oldMapin interfaceXImmutableTable<K,V>
-
keys
- Specified by:
keysin interfaceXGettingMap<K,V>- Specified by:
keysin interfaceXGettingTable<K,V>- Specified by:
keysin interfaceXImmutableMap<K,V>- Specified by:
keysin interfaceXImmutableTable<K,V>
-
values
- Specified by:
valuesin interfaceXGettingMap<K,V>- Specified by:
valuesin interfaceXGettingTable<K,V>- Specified by:
valuesin interfaceXImmutableMap<K,V>- Specified by:
valuesin interfaceXImmutableTable<K,V>
-
iterate
- Specified by:
iteratein interfaceXGettingEnum<K>- Specified by:
iteratein interfaceXGettingSet<K>- Specified by:
iteratein interfaceXIterable<K>
-
get
Description copied from interface:XGettingCollectionGets one element from the collection. If the collection is not orderedXGettingSequence, then it is undefined which element is returned. If the collection is ordered, the element at index 0 is returned.- Specified by:
getin interfaceXGettingCollection<K>- Specified by:
getin interfaceXGettingSequence<K>- Returns:
- the first / any element.
- See Also:
XGettingSequence.at(long),XGettingSequence.first(),XGettingSequence.last()
-
iterator
-
toArray
- Specified by:
toArrayin interfaceXGettingCollection<K>
-
toArray
- Specified by:
toArrayin interfaceXGettingCollection<K>
-
equality
- Specified by:
equalityin interfaceXGettingCollection<K>
-
equals
public boolean equals(XGettingCollection<? extends KeyValue<K,V>> samples, Equalator<? super KeyValue<K,V>> equalator)Description copied from interface:XGettingCollectionReturnstrueif the passed collection is of the same type as this collection andthis.equalsContent(list, equalator)yieldstrue.- Specified by:
equalsin interfaceXGettingCollection<K>
-
equalsContent
public boolean equalsContent(XGettingCollection<? extends KeyValue<K,V>> samples, Equalator<? super KeyValue<K,V>> equalator)Description copied from interface:XGettingCollectionReturnstrueif all elements of this list and the passed list are sequentially equal as defined by the passed equalator.Note that for colletion types that don't have a defined order of elements, this method is hardly usable (as is
XGettingCollection.equals(Object)for them as defined inCollection). The core problem of comparing collections that have no defined order is that they aren't really reliably comparable to any other collection.- Specified by:
equalsContentin interfaceXGettingCollection<K>equalator- the equalator to use to determine the equality of each element- Returns:
trueif this list is equal to the passed list, false otherwise
-
nullContained
public boolean nullContained()- Specified by:
nullContainedin interfaceXGettingCollection<K>
-
containsId
Description copied from interface:XGettingCollectionSpecial version of contains() that guarantees to use identity comparison (" == ") when searching for the given element regardless of the collection's internal logic.
This method has the same behavior asXGettingCollection.containsSearched(Predicate)with aPredicateimplementation that checks for object identity. The only difference is a performance and usability advantage- Specified by:
containsIdin interfaceXGettingCollection<K>- Parameters:
element- the element to be searched in the collection by identity.- Returns:
- whether this collection contains exactely the given element.
-
contains
- Specified by:
containsin interfaceXGettingCollection<K>
-
containsSearched
- Specified by:
containsSearchedin interfaceXGettingCollection<K>
-
containsAll
- Specified by:
containsAllin interfaceXGettingCollection<K>
-
applies
- Specified by:
appliesin interfaceXGettingCollection<K>
-
count
- Specified by:
countin interfaceXGettingCollection<K>
-
countBy
- Specified by:
countByin interfaceXGettingCollection<K>
-
search
- Specified by:
searchin interfaceXGettingCollection<K>
-
seek
Description copied from interface:XGettingCollectionReturns the first contained element matching the passed sample as defined by the collection's equality logic or null, if no fitting element is contained. (For collections using referential equality, this method is basically just a variation ofXGettingCollection.contains(Object)with a different return type. For collections with data-dependant equality, the returned element might be the same as the passed one or a data-wise equal one, depending on the content of the collection)- Specified by:
seekin interfaceXGettingCollection<K>
-
max
- Specified by:
maxin interfaceXGettingCollection<K>
-
min
- Specified by:
minin interfaceXGettingCollection<K>
-
distinct
- Specified by:
distinctin interfaceXGettingCollection<K>
-
distinct
public <T extends Consumer<? super KeyValue<K, V>>> T distinct(T target, Equalator<? super KeyValue<K,V>> equalator)- Specified by:
distinctin interfaceXGettingCollection<K>
-
copyTo
- Specified by:
copyToin interfaceXGettingCollection<K>
-
filterTo
public <T extends Consumer<? super KeyValue<K, V>>> T filterTo(T target, Predicate<? super KeyValue<K,V>> predicate)- Specified by:
filterToin interfaceXGettingCollection<K>
-
union
public <T extends Consumer<? super KeyValue<K, V>>> T union(XGettingCollection<? extends KeyValue<K,V>> other, Equalator<? super KeyValue<K,V>> equalator, T target)- Specified by:
unionin interfaceXGettingCollection<K>
-
intersect
public <T extends Consumer<? super KeyValue<K, V>>> T intersect(XGettingCollection<? extends KeyValue<K,V>> other, Equalator<? super KeyValue<K,V>> equalator, T target)- Specified by:
intersectin interfaceXGettingCollection<K>
-
except
public <T extends Consumer<? super KeyValue<K, V>>> T except(XGettingCollection<? extends KeyValue<K,V>> other, Equalator<? super KeyValue<K,V>> equalator, T target)- Specified by:
exceptin interfaceXGettingCollection<K>
-
join
-
toReversed
- Specified by:
toReversedin interfaceXGettingEnum<K>- Specified by:
toReversedin interfaceXGettingSequence<K>- Specified by:
toReversedin interfaceXImmutableEnum<K>- Specified by:
toReversedin interfaceXImmutableSequence<K>
-
view
- Specified by:
viewin interfaceXGettingEnum<K>- Specified by:
viewin interfaceXGettingSequence<K>
-
range
- Specified by:
rangein interfaceXGettingEnum<K>- Specified by:
rangein interfaceXGettingSequence<K>
-
at
- Specified by:
atin interfaceXGettingSequence<K>
-
first
- Specified by:
firstin interfaceXGettingSequence<K>
-
last
- Specified by:
lastin interfaceXGettingSequence<K>
-
poll
- Specified by:
pollin interfaceXGettingSequence<K>
-
peek
- Specified by:
peekin interfaceXGettingSequence<K>
-
maxIndex
- Specified by:
maxIndexin interfaceXGettingSequence<K>
-
minIndex
- Specified by:
minIndexin interfaceXGettingSequence<K>
-
indexOf
- Specified by:
indexOfin interfaceXGettingSequence<K>
-
indexBy
- Specified by:
indexByin interfaceXGettingSequence<K>
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceXGettingSequence<K>
-
lastIndexBy
- Specified by:
lastIndexByin interfaceXGettingSequence<K>
-
scan
Description copied from interface:XGettingSequenceIterates through the collection and returns the index of the last element that the passedPredicateapplied to ("scanning").- Specified by:
scanin interfaceXGettingSequence<K>- Returns:
- the index of the last positively tested element.
-
isSorted
- Specified by:
isSortedin interfaceXGettingSequence<K>
-
copySelection
- Specified by:
copySelectionin interfaceXGettingSequence<K>
-
iterateIndexed
- Specified by:
iterateIndexedin interfaceXIndexIterable<K>
-