1 /***
2 * GroupOperator.java
3 *
4 * $Author: mballesteros $
5 * $Date: 2003/11/28 19:18:03 $
6 * $Revision: 1.1 $
7 */
8 package net.sf.jec.namedop;
9
10 import java.util.HashMap;
11 import java.util.Iterator;
12 import java.util.Map;
13
14 import net.sf.jec.EvaluationException;
15 import net.sf.jec.Operator;
16
17
18 /*** GroupOperator is the abstract parent class of every operator that operates
19 * over a group (an object implementing the Map interface)
20 *
21 * @author mballesteros
22 */
23 public abstract class GroupOperator extends Operator {
24
25 /*** Creates a new GroupOperator
26 */
27 public GroupOperator() { }
28
29 /*** Applies operator over a group...
30 */
31 protected Object applyToGroup(Object rootCtx, Map map)
32 throws EvaluationException {
33 Map out = new HashMap();
34 Map.Entry entry;
35 Iterator it = map.entrySet().iterator();
36 while (it.hasNext()) {
37 entry = (Map.Entry)it.next();
38 out.put(entry.getKey(), directMap( rootCtx, entry.getValue() ));
39 }
40 return out;
41 }
42 }
This page was automatically generated by Maven