public interface BooleanSignalSourceVector<S extends BooleanSignalSource> extends List<S>
boolean
.
This interface is intended for grouping signal sources and routing parallel data flow at contruction time of a network. Objects that implement this interface should not themselves contribute to realtime behavior.
Modifier and Type | Interface and Description |
---|---|
static interface |
BooleanSignalSourceVector.Mutable<S extends BooleanSignalSource>
Interface of mutable aggregates of signal sources of primitive type
boolean . |
Modifier and Type | Method and Description |
---|---|
default BooleanSignalSourceVector<S> |
append(BooleanSignalSourceVector<S> other)
Returns a new aggregate that combines the components of this and the given
other aggregate in order.
|
static <S extends BooleanSignalSource> |
empty()
Creates a new aggregate with zero components.
|
static <S extends BooleanSignalSource> |
iterate(int size,
Supplier<? extends S> producer)
Creates a new aggregate with a given number components obtained from a producer.
|
default BooleanSignalSourceVector<BooleanSignalSource> |
map(BooleanUnaryOperator op)
Returns a new aggregate that is obtained by uniformly transforming the
values of the corresponding components of this aggregate.
|
static <S extends BooleanSignalSource> |
of(int size)
Creates a mutable aggregate of the given size.
|
static <S extends BooleanSignalSource> |
of(int size,
IntFunction<? extends S> components)
Creates a new aggregate from the given component-valued function.
|
static <S extends BooleanSignalSource> |
of(List<? extends S> components)
Creates a new aggregate from the given list of components.
|
static <S extends BooleanSignalSource> |
of(S... components)
Creates a new aggregate from the given array of components.
|
static <S extends BooleanSignalSource> |
repeat(int size,
S source)
Creates a new aggregate with a given number of identical references to the
same given signal source.
|
static <S extends BooleanSignalSource> |
singleton(S source)
Creates a new aggregate with one component.
|
default int |
sizeCompatibleWith(int expected)
Returns the number of components of this aggregate if equal to the
expected value.
|
default int |
sizeCompatibleWith(List<?> expected) |
default int |
sizeCompatibleWith(Object... expected) |
default BooleanClockedSignalSourceVector |
stored()
Returns a new aggegate whose components take snapshots of the
corresponding components of this aggregate.
|
default BooleanSignalSourceVector<BooleanSignalSource> |
zipWith(BooleanBinaryOperator op,
BooleanSignalSourceVector<?> other)
Returns a new aggregate that is obtained by uniformly combining the values
of the corresponding components of this and another aggregate.
|
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
parallelStream, removeIf, stream
@Undocumented default int sizeCompatibleWith(List<?> expected)
@Undocumented default int sizeCompatibleWith(Object... expected)
default int sizeCompatibleWith(int expected)
expected
- the expected number of componentsIllegalArgumentException
- if the number of components of
this aggregate is not equal to the expected number@SafeVarargs static <S extends BooleanSignalSource> BooleanSignalSourceVector<S> of(S... components)
The resulting object is a view of the passed array; concurrent mutation of array elements is observed. For immutable aggregates, no reference to the array should be shared.
components
- the componentsNullPointerException
- if components == null
static <S extends BooleanSignalSource> BooleanSignalSourceVector<S> of(List<? extends S> components)
The specified list is copied internally; later mutations of the original are not reflected.
components
- the componentsNullPointerException
- if components == null
static <S extends BooleanSignalSource> BooleanSignalSourceVector.Mutable<S> of(int size)
null
and must be set before use.size
- the number of components of the new aggregatestatic <S extends BooleanSignalSource> BooleanSignalSourceVector<S> of(int size, IntFunction<? extends S> components)
The given function is evaluated for all valid indices, from 0
to
size-1
, in unspecified order.
components
- the component functionNullPointerException
- if components == null
static <S extends BooleanSignalSource> BooleanSignalSourceVector<S> repeat(int size, S source)
size
- the number of elements of the new aggregatesource
- the signal source to use as componentIllegalArgumentException
- if size < 0
static <S extends BooleanSignalSource> BooleanSignalSourceVector<S> iterate(int size, Supplier<? extends S> producer)
size
- the number of elements of the new aggregateproducer
- the producer of signal source componentsIllegalArgumentException
- if size < 0
static <S extends BooleanSignalSource> BooleanSignalSourceVector<S> empty()
static <S extends BooleanSignalSource> BooleanSignalSourceVector<S> singleton(S source)
source
- the component of the new aggregatedefault BooleanSignalSourceVector<S> append(BooleanSignalSourceVector<S> other)
For app = this.append(other)
, it holds that app.size() ==
this.size() + other.size()
; furthermore, for m = this.size()
,
app.get(i) == this.get(i)
holds for i < m
, and app.get(i) == other.get(i - m)
holds for i >= m
.
other
- the other aggregatedefault BooleanSignalSourceVector<BooleanSignalSource> map(BooleanUnaryOperator op)
For that = this.map(f)
, it holds that that.size() ==
this.size()
; furthermore, at any point in time, that.get(i).getAsBoolean() ==
op.applyAsBoolean(this.get(i).getAsBoolean())
holds.
op
- the operator to apply to the values of all componentsBooleanSignalSource.map(BooleanUnaryOperator)
default BooleanSignalSourceVector<BooleanSignalSource> zipWith(BooleanBinaryOperator op, BooleanSignalSourceVector<?> other)
For that = this.map(f)
, it holds that that.size() ==
this.size() == other.size()
; furthermore, at any point in time, that.get(i).getAsBoolean() ==
op.applyAsBoolean(this.get(i).getAsBoolean(),
other.get(i).getAsBoolean())
holds.
op
- the operator to apply to the values of all componentsIllegalArgumentException
- if the two aggregates are of different sizeBooleanSignalSource.zipWith(BooleanBinaryOperator, BooleanSignalSource)
default BooleanClockedSignalSourceVector stored()
BooleanSignalSource.stored()