88public final class functional_stream implements Function {
99
1010 @ Override
11- public Value execute (Value ... args ) {
11+ public Value execute (Value [] args ) {
1212 Arguments .checkAtLeast (1 , args .length );
1313
1414 if (args .length > 1 ) {
@@ -52,10 +52,11 @@ private void init() {
5252 set ("reduce" , wrapTerminal (new functional_reduce ()));
5353 set ("forEach" , wrapTerminal (new functional_foreach ()));
5454 set ("toArray" , args -> container );
55+ set ("joining" , container ::joinToString );
5556 set ("count" , args -> NumberValue .of (container .size ()));
5657 }
5758
58- private Value skip (Value ... args ) {
59+ private Value skip (Value [] args ) {
5960 Arguments .check (1 , args .length );
6061
6162 final int skipCount = args [0 ].asInt ();
@@ -71,7 +72,7 @@ private Value skip(Value... args) {
7172 return new StreamValue (new ArrayValue (result ));
7273 }
7374
74- private Value limit (Value ... args ) {
75+ private Value limit (Value [] args ) {
7576 Arguments .check (1 , args .length );
7677
7778 final int limitCount = args [0 ].asInt ();
@@ -87,7 +88,7 @@ private Value limit(Value... args) {
8788 return new StreamValue (new ArrayValue (result ));
8889 }
8990
90- private Value sorted (Value ... args ) {
91+ private Value sorted (Value [] args ) {
9192 Arguments .checkOrOr (0 , 1 , args .length );
9293 final Value [] elements = container .getCopyElements ();
9394
@@ -106,7 +107,7 @@ private Value sorted(Value... args) {
106107 return new StreamValue (new ArrayValue (elements ));
107108 }
108109
109- private Value custom (Value ... args ) {
110+ private Value custom (Value [] args ) {
110111 Arguments .check (1 , args .length );
111112 final Function f = ValueUtils .consumeFunction (args [0 ], 0 );
112113 final Value result = f .execute (container );
@@ -115,7 +116,7 @@ private Value custom(Value... args) {
115116 }
116117 return result ;
117118 }
118-
119+
119120 private FunctionValue wrapIntermediate (Function f ) {
120121 return wrap (f , true );
121122 }
0 commit comments