Skip to main content

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​

NameDescription
Ethe element type
sealed

Properties​

_NonEmptyType​

undocumented

Definition​

readonly _NonEmptyType: unknown;

isEmpty​

Returns false 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.

Definition​

[Symbol.iterator](): FastIterator<E>;

Overrides​

FastIterable.[Symbol.iterator]

asNormal​

Returns this typed as a possibly-empty collection type.

Definition​

asNormal(): any;

assumeNonEmpty​

Returns this, 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.

Definition​

nonEmpty(): this is this['_NonEmptyType'];

stream​

Returns a non-empty Stream containing all elements of the collection.

Definition​

abstract stream(): Stream.NonEmpty<E>;