KickJava   Java API By Example, From Geeks To Geeks.

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


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.xmla;
14
15 import java.util.ArrayList JavaDoc;
16 import java.util.List JavaDoc;
17
18 import com.tonbeller.jpivot.olap.model.Axis;
19 import com.tonbeller.jpivot.olap.model.Hierarchy;
20 import com.tonbeller.jpivot.olap.model.Visitor;
21
22 /**
23  * Result Axis XMLA
24  */

25 public class XMLA_Axis implements Axis {
26
27   private String JavaDoc name;
28
29   private int ordinal;
30   private int nHier = 0;
31
32   private List JavaDoc aHiers = new ArrayList JavaDoc();
33   private List JavaDoc aPositions = new ArrayList JavaDoc();
34
35   /**
36    * c'tor
37    * @param name
38    */

39   XMLA_Axis(int ordinal, String JavaDoc name) {
40     this.ordinal = ordinal;
41     this.name = name;
42   }
43
44   void addHier(XMLA_Hierarchy hier) {
45     aHiers.add(hier);
46     ++nHier;
47   }
48
49   /**
50    * Returns the name.
51    * @return String
52    */

53   public String JavaDoc getName() {
54     return name;
55   }
56
57   /**
58    * Returns the nHier.
59    * @return int
60    */

61   public int getNHier() {
62     return nHier;
63   }
64
65   /**
66    * add position
67    * @param pos
68    */

69   void addPosition(XMLA_Position pos) {
70     aPositions.add(pos);
71   }
72   /**
73    * @see com.tonbeller.jpivot.olap.model.Axis#getPositions()
74    */

75   public List JavaDoc getPositions() {
76     return aPositions;
77   }
78   /**
79    * @see com.tonbeller.jpivot.olap.model.Axis#getHierarchies()
80    */

81   public Hierarchy[] getHierarchies() {
82     return (Hierarchy[])aHiers.toArray(new Hierarchy[0]);
83   }
84
85   /**
86   * @see com.tonbeller.jpivot.olap.model.Visitable#accept(Visitor)
87   */

88   public void accept(Visitor visitor) {
89     visitor.visitAxis(this);
90   }
91
92   public Object JavaDoc getRootDecoree() {
93     return this;
94   }
95
96   /**
97    * @return the ordinal of the axis , slicer = -1
98    */

99   public int getOrdinal() {
100     return ordinal;
101   }
102
103 } // End XMLA_Axis
104
Popular Tags