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,JxnLandJxnDtogether implement all interfaces of packagejava.util.functionforjava.util.stream. This allows to explore and use java → aggregate operations interactively from JXN.JxnFimplements all single or zero parameter methods,JxnF2all double parameter methods andJxnI,JxnLandJxnDmethods incompatible withPredicate.- See Also:
- AggregateOperations_Demo.jxn
-
-
Constructor Summary
Constructors Constructor Description JxnF(JxnFunction f)ConstructsJxnFfrom 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)
ConstructsJxnFfrom an already definedJxnFunction f.
Can be used, iffis 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:JxnFunctionMapsargsto$_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:
execin classJxnFunction
-
test
public boolean test(Object t)
ImplementsPredicateforStream<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:
getAsIntin interfaceIntSupplier
-
getAsLong
public long getAsLong()
- Specified by:
getAsLongin interfaceLongSupplier
-
getAsDouble
public double getAsDouble()
- Specified by:
getAsDoublein interfaceDoubleSupplier
-
getAsBoolean
public boolean getAsBoolean()
ImplementsBooleanSupplier.- Specified by:
getAsBooleanin interfaceBooleanSupplier
-
apply
public Object apply(Object t)
ImplementsFunctionforStream<T>.map(…),.flatMap(…),.flatMapToInt(…),.flatMapToLong(…),.flatMapToDouble(…),Collector.of(…),Collectors.collectingAndThen(…),.groupingBy(…),.groupingByConcurrent(…),.mapping(…),.toMap(…),.toConcurrentMap(…),.reducing(…)andUnaryOperatorforStream<T>.iterate(…).
-
apply
public Object apply(int value)
- Specified by:
applyin interfaceIntFunction
-
apply
public Object apply(long value)
- Specified by:
applyin interfaceLongFunction
-
apply
public Object apply(double value)
- Specified by:
applyin interfaceDoubleFunction
-
applyAsInt
public int applyAsInt(Object value)
ImplementsToIntFunctionforStream<T>.mapToInt(…),Collectors.averagingInt(…),.summingInt(…),.summarizingInt(…).- Specified by:
applyAsIntin interfaceToIntFunction
-
applyAsInt
public int applyAsInt(int operand)
- Specified by:
applyAsIntin interfaceIntUnaryOperator
-
applyAsInt
public int applyAsInt(long value)
- Specified by:
applyAsIntin interfaceLongToIntFunction
-
applyAsInt
public int applyAsInt(double value)
- Specified by:
applyAsIntin interfaceDoubleToIntFunction
-
applyAsLong
public long applyAsLong(Object value)
ImplementsToLongFunctionforStream<T>.mapToLong(…),Collectors.averagingLong(…),.summingLong(…),.summarizingLong(…).- Specified by:
applyAsLongin interfaceToLongFunction
-
applyAsLong
public long applyAsLong(int value)
- Specified by:
applyAsLongin interfaceIntToLongFunction
-
applyAsLong
public long applyAsLong(long operand)
- Specified by:
applyAsLongin interfaceLongUnaryOperator
-
applyAsLong
public long applyAsLong(double value)
- Specified by:
applyAsLongin interfaceDoubleToLongFunction
-
applyAsDouble
public double applyAsDouble(Object value)
ImplementsToDoubleFunctionforStream<T>.mapToDouble(…),Collectors.averagingDouble(…),.summingDouble(…),.summarizingDouble(…).- Specified by:
applyAsDoublein interfaceToDoubleFunction
-
applyAsDouble
public double applyAsDouble(int value)
- Specified by:
applyAsDoublein interfaceIntToDoubleFunction
-
applyAsDouble
public double applyAsDouble(long value)
- Specified by:
applyAsDoublein interfaceLongToDoubleFunction
-
applyAsDouble
public double applyAsDouble(double operand)
- Specified by:
applyAsDoublein interfaceDoubleUnaryOperator
-
accept
public void accept(Object t)
ImplementsConsumerforStream<T>.forEach(…),.forEachOrdered(…),.peek(…),Iterator.forEachRemaining(…).
-
accept
public void accept(int value)
- Specified by:
acceptin interfaceIntConsumer
-
accept
public void accept(long value)
- Specified by:
acceptin interfaceLongConsumer
-
accept
public void accept(double value)
- Specified by:
acceptin interfaceDoubleConsumer
-
-