Class JxnF
-
- All Implemented Interfaces:
BooleanSupplier
,Consumer
,DoubleConsumer
,DoubleFunction
,DoubleSupplier
,DoubleToIntFunction
,DoubleToLongFunction
,DoubleUnaryOperator
,Function
,IntConsumer
,IntFunction
,IntSupplier
,IntToDoubleFunction
,IntToLongFunction
,IntUnaryOperator
,LongConsumer
,LongFunction
,LongSupplier
,LongToDoubleFunction
,LongToIntFunction
,LongUnaryOperator
,Predicate
,Supplier
,ToDoubleFunction
,ToIntFunction
,ToLongFunction
,UnaryOperator
public class JxnF extends JxnFunction implements Predicate, Supplier, IntSupplier, LongSupplier, DoubleSupplier, BooleanSupplier, Function, IntFunction, LongFunction, DoubleFunction, UnaryOperator, ToIntFunction, ToLongFunction, ToDoubleFunction, IntUnaryOperator, IntToLongFunction, IntToDoubleFunction, LongUnaryOperator, LongToIntFunction, LongToDoubleFunction, DoubleUnaryOperator, DoubleToIntFunction, DoubleToLongFunction, Consumer, IntConsumer, LongConsumer, DoubleConsumer
The classesJxnF
,JxnF2
,JxnI
,JxnL
andJxnD
together implement all interfaces of packagejava.util.function
forjava.util.stream
. This allows to explore and use java → aggregate operations interactively from JXN.JxnF
implements all single or zero parameter methods,JxnF2
all double parameter methods andJxnI
,JxnL
andJxnD
methods incompatible withPredicate
.- See Also:
- AggregateOperations_Demo.jxn
-
-
Constructor Summary
Constructors Constructor Description JxnF(JxnFunction f)
ConstructsJxnF
from an already definedJxnFunction f
.JxnF(KmgFormelInterpreter fi, String cmd)
Calls constructorJxnFunction( fi, cmd )
.
-
Method Summary
-
Methods inherited from interface java.util.function.DoubleConsumer
andThen
-
Methods inherited from interface java.util.function.DoubleUnaryOperator
andThen, compose
-
Methods inherited from interface java.util.function.IntConsumer
andThen
-
Methods inherited from interface java.util.function.IntUnaryOperator
andThen, compose
-
Methods inherited from class JxnFunction
getArityLenience, getDebug, getShowConditional, getShowInternalResults, setArityLenience, setDebug, setShowConditional, setShowInternalResults, toString
-
Methods inherited from interface java.util.function.LongConsumer
andThen
-
Methods inherited from interface java.util.function.LongUnaryOperator
andThen, compose
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.function.UnaryOperator
-
-
-
-
Constructor Detail
-
JxnF
public JxnF(JxnFunction f)
ConstructsJxnF
from an already definedJxnFunction f
.
Can be used, iff
is defined using jxn special commands:#function f ... #endfunction
- See Also:
JxnF2(JxnFunction)
-
JxnF
public JxnF(KmgFormelInterpreter fi, String cmd)
Calls constructorJxnFunction( fi, cmd )
.- Parameters:
cmd
- statement_sequence (one or more statements separated by';'
) or #filename[.jxn]. (Note: jxn does not support{…}
blocks as possible in java → lambda expressions)- See Also:
JxnF2(KmgFormelInterpreter,java.lang.String)
-
-
Method Detail
-
execute
protected Object execute()
-
exec
protected Object exec(Object[] args)
Description copied from class:JxnFunction
Mapsargs
to$_
and the names passed to the constructor viaparameterNames
.
Example:
fn = @JxnFunction( … ) !
calls a constructor to create a function instancefn
:
fn( arg1, arg2, ..., argN ) !
⇒ jxn internally callsfn.exec( { arg1, arg2, ..., argN } )
- Overrides:
exec
in classJxnFunction
-
test
public boolean test(Object t)
ImplementsPredicate
forStream<T>
.filter(…)
,.allMatch(…)
,.anyMatch(…)
,.noneMatch(…)
,Collectors
.partitioningBy(…)
.
-
test
public boolean test(int value)
-
test
public boolean test(long value)
-
test
public boolean test(double value)
-
get
public Object get()
-
getAsInt
public int getAsInt()
- Specified by:
getAsInt
in interfaceIntSupplier
-
getAsLong
public long getAsLong()
- Specified by:
getAsLong
in interfaceLongSupplier
-
getAsDouble
public double getAsDouble()
- Specified by:
getAsDouble
in interfaceDoubleSupplier
-
getAsBoolean
public boolean getAsBoolean()
ImplementsBooleanSupplier
.- Specified by:
getAsBoolean
in interfaceBooleanSupplier
-
apply
public Object apply(Object t)
ImplementsFunction
forStream<T>
.map(…)
,.flatMap(…)
,.flatMapToInt(…)
,.flatMapToLong(…)
,.flatMapToDouble(…)
,Collector
.of(…)
,Collectors
.collectingAndThen(…)
,.groupingBy(…)
,.groupingByConcurrent(…)
,.mapping(…)
,.toMap(…)
,.toConcurrentMap(…)
,.reducing(…)
andUnaryOperator
forStream<T>
.iterate(…)
.
-
apply
public Object apply(int value)
- Specified by:
apply
in interfaceIntFunction
-
apply
public Object apply(long value)
- Specified by:
apply
in interfaceLongFunction
-
apply
public Object apply(double value)
- Specified by:
apply
in interfaceDoubleFunction
-
applyAsInt
public int applyAsInt(Object value)
ImplementsToIntFunction
forStream<T>
.mapToInt(…)
,Collectors
.averagingInt(…)
,.summingInt(…)
,.summarizingInt(…)
.- Specified by:
applyAsInt
in interfaceToIntFunction
-
applyAsInt
public int applyAsInt(int operand)
- Specified by:
applyAsInt
in interfaceIntUnaryOperator
-
applyAsInt
public int applyAsInt(long value)
- Specified by:
applyAsInt
in interfaceLongToIntFunction
-
applyAsInt
public int applyAsInt(double value)
- Specified by:
applyAsInt
in interfaceDoubleToIntFunction
-
applyAsLong
public long applyAsLong(Object value)
ImplementsToLongFunction
forStream<T>
.mapToLong(…)
,Collectors
.averagingLong(…)
,.summingLong(…)
,.summarizingLong(…)
.- Specified by:
applyAsLong
in interfaceToLongFunction
-
applyAsLong
public long applyAsLong(int value)
- Specified by:
applyAsLong
in interfaceIntToLongFunction
-
applyAsLong
public long applyAsLong(long operand)
- Specified by:
applyAsLong
in interfaceLongUnaryOperator
-
applyAsLong
public long applyAsLong(double value)
- Specified by:
applyAsLong
in interfaceDoubleToLongFunction
-
applyAsDouble
public double applyAsDouble(Object value)
ImplementsToDoubleFunction
forStream<T>
.mapToDouble(…)
,Collectors
.averagingDouble(…)
,.summingDouble(…)
,.summarizingDouble(…)
.- Specified by:
applyAsDouble
in interfaceToDoubleFunction
-
applyAsDouble
public double applyAsDouble(int value)
- Specified by:
applyAsDouble
in interfaceIntToDoubleFunction
-
applyAsDouble
public double applyAsDouble(long value)
- Specified by:
applyAsDouble
in interfaceLongToDoubleFunction
-
applyAsDouble
public double applyAsDouble(double operand)
- Specified by:
applyAsDouble
in interfaceDoubleUnaryOperator
-
accept
public void accept(Object t)
ImplementsConsumer
forStream<T>
.forEach(…)
,.forEachOrdered(…)
,.peek(…)
,Iterator.forEachRemaining(…)
.
-
accept
public void accept(int value)
- Specified by:
accept
in interfaceIntConsumer
-
accept
public void accept(long value)
- Specified by:
accept
in interfaceLongConsumer
-
accept
public void accept(double value)
- Specified by:
accept
in interfaceDoubleConsumer
-
-