KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > jpivot > olap > model > Dimension


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;
14
15 import java.util.Comparator JavaDoc;
16
17
18
19
20 /**
21  * OLAP Dimension
22  * @author av
23  */

24 public interface Dimension extends Expression, Displayable, Visitable, Decorator {
25
26   /**
27    * sorts Dimensions by labels except Measures which always comes first.
28    */

29   static Comparator JavaDoc MEASURES_FIRST_COMPARATOR = new Comparator JavaDoc() {
30     public int compare(Object JavaDoc o1, Object JavaDoc o2) {
31       Dimension d1 = (Dimension) o1;
32       Dimension d2 = (Dimension) o2;
33       if (d1.isMeasure() != d2.isMeasure())
34         return d1.isMeasure() ? -1 : 1;
35       return d1.getLabel().compareTo(d2.getLabel());
36     }
37   };
38
39   /**
40    * return the hierarchies of this dimension
41    */

42   Hierarchy[] getHierarchies();
43   
44   /**
45    * return true if this is a time dimension. Its common to have multiple time
46    * dimensions, e.g. one for receipt of order and one for shipping.
47    */

48   boolean isTime();
49   
50   /**
51    * true if this is the measures dimension
52    */

53   boolean isMeasure();
54 }
55
Popular Tags