KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > jpivot > test > olap > TestSetParameter


1 /*
2  * ====================================================================
3  * This software is subject to the terms of the Common Public License
4  * Agreement, available at the following URL:
5  * http://www.opensource.org/licenses/cpl.html .
6  * Copyright (C) 2003-2004 TONBELLER AG.
7  * All Rights Reserved.
8  * You must accept the terms of that agreement to use this software.
9  * ====================================================================
10  *
11  *
12  */

13 package com.tonbeller.jpivot.test.olap;
14
15 import java.util.HashMap JavaDoc;
16 import java.util.Map JavaDoc;
17 import java.util.Set JavaDoc;
18
19 import com.tonbeller.jpivot.olap.model.Displayable;
20 import com.tonbeller.jpivot.olap.model.Expression;
21 import com.tonbeller.jpivot.olap.navi.SetParameter;
22
23 /**
24  * @author av
25  */

26 public class TestSetParameter extends TestExtensionSupport implements SetParameter {
27   Map JavaDoc params = new HashMap JavaDoc();
28   
29   public void setParameter(String JavaDoc paramName, Expression paramValue) {
30     String JavaDoc label = ((Displayable)paramValue).getLabel();
31     System.out.println("setting Parameter " + paramName + " to " + label);
32     params.put(paramName, label);
33   }
34   
35   /** for scripting */
36   public Map JavaDoc getDisplayValues() {
37     return params;
38   }
39   
40   public String JavaDoc[] getParameterNames() {
41     Set JavaDoc keys = params.keySet();
42     return (String JavaDoc[]) keys.toArray(new String JavaDoc[keys.size()]);
43   }
44
45 }
46
Popular Tags