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.
Type parameters
| Name | Description |
|---|---|
| E | the element type |
sealed
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]Definition
[Symbol.iterator](): FastIterator<E>;
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>;