66import java .nio .charset .Charset ;
77import java .nio .file .*;
88import java .util .*;
9- import java .util .Map .Entry ;
10- import java .util .function .*;
9+ import java .util .function .Function ;
1110import java .util .stream .*;
1211
1312import org .apache .commons .lang3 .StringUtils ;
@@ -198,8 +197,8 @@ public static <A, B> Set<B> map(Set<A> set, Function<? super A, B> function) {
198197 return set .stream ().map (function ).collect (Collectors .toSet ());
199198 }
200199
201- public static <A , B , C , D > Collector < Entry < A , B >, ?, Map <C , D >> mapCollector ( Function <? super A , C > keyFunction , Function <? super B , D > valueFunction , BinaryOperator < D > mergeFunction ) {
202- return Collectors .toMap (x -> keyFunction .apply (x .getKey ()), x -> valueFunction .apply (x .getValue ()), mergeFunction );
200+ public static <A , B , C , D > Map < C , D > map ( Map <A , B > map , Function <? super A , C > keyFunction , Function <? super B , D > valueFunction ) {
201+ return map . entrySet (). stream (). collect ( Collectors .toMap (x -> keyFunction .apply (x .getKey ()), x -> valueFunction .apply (x .getValue ()), ( x , y ) -> y ) );
203202 }
204203
205204 public static final Set <String > KEYWORDS = new HashSet <>();
@@ -222,23 +221,18 @@ public static <A, B> Set<B> map(Set<A> set, Function<? super A, B> function) {
222221
223222 public static final String NEW = "new" ;
224223
225- public static final String NULL = "null" ;
226224 public static final String DEREF = "deref" ;
227225
226+ public static final String NULL = "null" ;
228227 public static final String TYPE = "type" ;
229228 public static final String CAST = "cast" ;
230229
231230 public static final String EXCH = "exch" ;
231+ public static final String ROLL = "roll" ;
232232 public static final String POP = "pop" ;
233233 public static final String DUP = "dup" ;
234234
235- public static final String ROLL = "roll" ;
236- public static final String RID = "rid" ;
237- public static final String COPY = "copy" ;
238-
239- public static final String INDEX = "index" ;
240- public static final String COUNT = "count" ;
241- public static final String COUNTTO = "countto" ;
235+ public static final String STACKSIZE = "stacksize" ;
242236
243237 public static final String READ = "read" ;
244238 public static final String PRINT = "print" ;
@@ -324,23 +318,18 @@ public static <A, B> Set<B> map(Set<A> set, Function<? super A, B> function) {
324318
325319 KEYWORDS .add (NEW );
326320
327- KEYWORDS .add (NULL );
328321 KEYWORDS .add (DEREF );
329322
323+ KEYWORDS .add (NULL );
330324 KEYWORDS .add (TYPE );
331325 KEYWORDS .add (CAST );
332326
333327 KEYWORDS .add (EXCH );
328+ KEYWORDS .add (ROLL );
334329 KEYWORDS .add (POP );
335330 KEYWORDS .add (DUP );
336331
337- KEYWORDS .add (ROLL );
338- KEYWORDS .add (RID );
339- KEYWORDS .add (COPY );
340-
341- KEYWORDS .add (INDEX );
342- KEYWORDS .add (COUNT );
343- KEYWORDS .add (COUNTTO );
332+ KEYWORDS .add (STACKSIZE );
344333
345334 KEYWORDS .add (READ );
346335 KEYWORDS .add (PRINT );
0 commit comments