KickJava   Java API By Example, From Geeks To Geeks.

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


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 com.tonbeller.jpivot.olap.model.Member;
16 import com.tonbeller.jpivot.olap.query.PositionBase;
17
18 /**
19  * XMLA Position
20  */

21 public class XMLA_Position extends PositionBase {
22
23   int axisOrdinal;
24
25   /**
26    *
27    * @param axisOrdinal
28    */

29   protected XMLA_Position(int axisOrdinal) {
30     super();
31     this.axisOrdinal = axisOrdinal;
32   }
33
34   /**
35     * Sets the members.
36     * @param members The members to set
37     */

38   public void setMembers(Member[] members) {
39     this.members = members;
40   }
41
42   /**
43    * Sets the axisOrdinal.
44    * @param axisOrdinal The axisOrdinal to set
45    */

46   public void setAxisOrdinal(int axisOrdinal) {
47     this.axisOrdinal = axisOrdinal;
48   }
49
50   /**
51    * Returns the axisOrdinal.
52    * @return int
53    */

54   public int getAxisOrdinal() {
55     return axisOrdinal;
56   }
57
58   /**
59    *
60    * @param other
61    * @return boolean
62    */

63   public boolean isEquivalent(XMLA_Position other) {
64     // same positions, if members are equal
65
Member[] othermembers = other.getMembers();
66     int nMembers = members.length;
67     if (othermembers.length != nMembers)
68       return false;
69     for (int i = 0; i < nMembers; i++) {
70       if (!othermembers[i].getLabel().equals(members[i].getLabel()))
71         return false;
72     }
73     return true;
74   }
75
76 } // XMLA_Position
77
Popular Tags