Class IterableSize<V>
- java.lang.Object
-
- org.tensorics.core.scalar.lang.ScalarSupport<V>
-
- org.tensorics.core.iterable.operations.IterableSize<V>
-
- Type Parameters:
V
- the type of the elements of the field.
- All Implemented Interfaces:
java.util.function.Function<java.lang.Iterable<?>,V>
,BasicOperationSupport<V>
,Conversion<java.lang.Iterable<?>,V>
public class IterableSize<V> extends ScalarSupport<V> implements Conversion<java.lang.Iterable<?>,V>
An operation which counts the number of entries in an iterable and returns a scalar, corresponding to the count.
-
-
Constructor Summary
Constructors Constructor Description IterableSize(ExtendedField<V> field)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description V
apply(java.lang.Iterable<?> iterable)
Has to implement the conversion logic to convert the given object into an object of type R.-
Methods inherited from class org.tensorics.core.scalar.lang.ScalarSupport
absoluteValueOf, calculate, countOf, field, inverseOf, negativeOf, one, squareOf, squareRootOf, testIf, two, zero
-
-
-
-
Constructor Detail
-
IterableSize
public IterableSize(ExtendedField<V> field)
-
-
Method Detail
-
apply
public V apply(java.lang.Iterable<?> iterable)
Description copied from interface:Conversion
Has to implement the conversion logic to convert the given object into an object of type R.- Specified by:
apply
in interfaceConversion<java.lang.Iterable<?>,V>
- Specified by:
apply
in interfacejava.util.function.Function<java.lang.Iterable<?>,V>
- Parameters:
iterable
- the object to convert- Returns:
- an object of the correct return type.
-
-