abstract class NonEmptyBase<E>
A shared base class for non-empty collection instances.
It implements the common Collection.NonEmpty API and is reused across different non-empty collection types.
Implements: FastIterable<T>
Extended by: HashSetNonEmptyBase<T>, OrderedMapNonEmpty<K,V,Tp,TpG>, ValuedGraphNonEmpty<N,V,Tp,TpG>, BiMapNonEmptyImpl<K,V>, OrderedSetNonEmpty<T,Tp,TpG>, HashMapNonEmptyBase<K,V>, GraphNonEmpty<N,Tp,TpG>, TableNonEmpty<R,C,V,Tp,TpR>, MultiMapNonEmpty<K,V,Tp,TpG>, BiMultiMapNonEmpty<K,V,Tp,TpG>, MultiSetNonEmpty<T,Tp,TpG>
Type parameters
| Name | Description |
|---|---|
| E | the element type |
Properties
isEmpty
Returns false since the collection is known to be non-empty.
isEmptyfalse since the collection is known to be non-empty.Definition
get isEmpty(): false;
Methods
[Symbol.iterator]
Returns a fast iterator over the elements of the collection.
[Symbol.iterator]assumeNonEmpty
Returns this, since the collection is already known to be non-empty.
assumeNonEmptythis, since the collection is already known to be non-empty.Definition
assumeNonEmpty(): this;
nonEmpty
Returns true and instructs the compiler to treat the instance as non-empty.
nonEmptytrue and instructs the compiler to treat the instance as non-empty.Definition
nonEmpty(): this is this['_NonEmptyType'];
stream
Returns a non-empty Stream containing all elements of the collection.
streamStream containing all elements of the collection.Definition
abstract stream(): Stream.NonEmpty<E>;