public interface IntSignalSourceVector<S extends IntSignalSource> extends List<S>
int
.
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.
PrimitiveIntSignalSourceVector
,
IntSignalSource
Modifier and Type | Interface and Description |
---|---|
static interface |
IntSignalSourceVector.Mutable<S extends IntSignalSource>
Interface of mutable aggregates of signal sources of primitive type
int . |
Modifier and Type | Method and Description |
---|---|
default IntSignalSourceVector<S> |
append(IntSignalSourceVector<S> other)
Returns a new aggregate that combines the components of this and the given
other aggregate in order.
|
static <S extends IntSignalSource> |
empty()
Creates a new aggregate with zero components.
|
static <S extends IntSignalSource> |
iterate(int size,
Supplier<? extends S> producer)
Creates a new aggregate with a given number components obtained from a producer.
|
default IntSignalSourceVector<IntSignalSource> |
map(IntUnaryOperator op)
Returns a new aggregate that is obtained by uniformly transforming the
values of the corresponding components of this aggregate.
|
static <S extends IntSignalSource> |
of(int size)
Creates a mutable aggregate of the given size.
|
static <S extends IntSignalSource> |
of(int size,
IntFunction<? extends S> components)
Creates a new aggregate from the given component-valued function.
|
static <S extends IntSignalSource> |
of(List<? extends S> components)
Creates a new aggregate from the given list of components.
|
static <S extends IntSignalSource> |
of(S... components)
Creates a new aggregate from the given array of components.
|
static <S extends IntSignalSource> |
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 IntSignalSource> |
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 IntClockedSignalSourceVector |
stored()
Returns a new aggegate whose components take snapshots of the
corresponding components of this aggregate.
|
default IntSignalSourceVector<IntSignalSource> |
zipWith(IntBinaryOperator op,
IntSignalSourceVector<?> 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 IntSignalSource> IntSignalSourceVector<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 IntSignalSource> IntSignalSourceVector<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 IntSignalSource> IntSignalSourceVector.Mutable<S> of(int size)
null
and must be set before use.size
- the number of components of the new aggregatestatic <S extends IntSignalSource> IntSignalSourceVector<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 IntSignalSource> IntSignalSourceVector<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 IntSignalSource> IntSignalSourceVector<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 IntSignalSource> IntSignalSourceVector<S> empty()
static <S extends IntSignalSource> IntSignalSourceVector<S> singleton(S source)
source
- the component of the new aggregatedefault IntSignalSourceVector<S> append(IntSignalSourceVector<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 IntSignalSourceVector<IntSignalSource> map(IntUnaryOperator op)
For that = this.map(f)
, it holds that that.size() ==
this.size()
; furthermore, at any point in time, that.get(i).getAsInt() ==
op.applyAsInt(this.get(i).getAsInt())
holds.
op
- the operator to apply to the values of all componentsIntSignalSource.map(IntUnaryOperator)
default IntSignalSourceVector<IntSignalSource> zipWith(IntBinaryOperator op, IntSignalSourceVector<?> other)
For that = this.map(f)
, it holds that that.size() ==
this.size() == other.size()
; furthermore, at any point in time, that.get(i).getAsInt() ==
op.applyAsInt(this.get(i).getAsInt(),
other.get(i).getAsInt())
holds.
op
- the operator to apply to the values of all componentsIllegalArgumentException
- if the two aggregates are of different sizeIntSignalSource.zipWith(IntBinaryOperator, IntSignalSource)
default IntClockedSignalSourceVector stored()
IntSignalSource.stored()