KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > jpivot > xmla > XMLA_OlapItem


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  
14 package com.tonbeller.jpivot.xmla;
15
16 import java.util.HashMap JavaDoc;
17 import java.util.Map JavaDoc;
18
19 import com.tonbeller.jpivot.olap.model.OlapItem;
20
21 /**
22  * XMLA Olap Item
23  */

24 public class XMLA_OlapItem implements OlapItem {
25
26   private int type;
27     private Map JavaDoc propMap = new HashMap JavaDoc();
28     private String JavaDoc caption = null;
29     private String JavaDoc name;
30     private String JavaDoc uniqueName;
31
32   /**
33    * c'tor
34    * @param type
35    */

36   public XMLA_OlapItem(int type) {
37     this.type = type;
38    }
39
40   /**
41    * @return type of item
42    */

43   public int getType() {
44     return type;
45   }
46   
47     /**
48      * Label is the string to be externally displayed
49      * @return label
50      */

51     public String JavaDoc getLabel() {
52         if (caption != null)
53           return caption;
54         else
55           return name;
56     }
57
58   /**
59     * @return the unique name
60     */

61     public String JavaDoc getUniqueName() {
62         return uniqueName;
63     }
64
65   /**
66     * @return caption (can be null)
67     */

68     public String JavaDoc getCaption() {
69         return caption;
70     }
71
72   /**
73    * @return name
74    */

75     public String JavaDoc getName() {
76       return name;
77     }
78
79   /**
80     * @param propName name of the property to be retrieved
81     * @return
82     */

83   public String JavaDoc getProperty(String JavaDoc propName) {
84     return (String JavaDoc) propMap.get(propName);
85   }
86
87   
88   /**
89    * any OlapItem contains a map of properties,
90    * key and value of type String
91    * @return properties property map
92    */

93     public Map JavaDoc getProperties() {
94         return propMap;
95     }
96
97   /**
98    * @param name
99    */

100   public void setName(String JavaDoc name) {
101     this.name = name;
102   }
103
104   /**
105    * @param caption
106    */

107   public void setCaption(String JavaDoc caption) {
108     this.caption = caption;
109   }
110
111
112   /**
113    * @param propName property name
114    * @param value property value
115    */

116   public void setProperty(String JavaDoc propName, String JavaDoc value) {
117     propMap.put(propName, value);
118   }
119
120   /**
121    * @param string
122    */

123   public void setUniqueName(String JavaDoc string) {
124     uniqueName = string;
125     if (name == null)
126       name = string;
127   }
128
129 } // XMLA_OlapItem
130
Popular Tags