KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > jpivot > olap > model > impl > LevelImpl


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.olap.model.impl;
14
15 import com.tonbeller.jpivot.olap.model.Hierarchy;
16 import com.tonbeller.jpivot.olap.model.Level;
17 import com.tonbeller.jpivot.olap.model.Visitor;
18
19 /**
20  * Created on 11.10.2002
21  *
22  * @author av
23  */

24 public class LevelImpl implements Level {
25   String JavaDoc label;
26   Hierarchy hierarchy;
27
28   public LevelImpl() {
29   }
30
31   public LevelImpl(String JavaDoc label, Hierarchy hierarchy) {
32     this.label = label;
33     this.hierarchy = hierarchy;
34   }
35
36   /**
37    * Returns the hierarchy.
38    * @return Hierarchy
39    */

40   public Hierarchy getHierarchy() {
41     return hierarchy;
42   }
43
44   /**
45    * Sets the hierarchy.
46    * @param hierarchy The hierarchy to set
47    */

48   public void setHierarchy(Hierarchy hierarchy) {
49     this.hierarchy = hierarchy;
50   }
51
52   public void accept(Visitor visitor) {
53     visitor.visitLevel(this);
54   }
55
56   public Object JavaDoc getRootDecoree() {
57     return this;
58   }
59
60   /**
61    * Returns the label.
62    * @return String
63    */

64   public String JavaDoc getLabel() {
65     return label;
66   }
67
68   /**
69    * Sets the label.
70    * @param label The label to set
71    */

72   public void setLabel(String JavaDoc label) {
73     this.label = label;
74   }
75
76   /**
77    * @return unique name
78    */

79   public String JavaDoc getUniqueName() {
80     return "[" + label + "]";
81   }
82
83 }
84
Popular Tags