KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > jpivot > olap > navi > MemberTree


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.navi;
14
15 import com.tonbeller.jpivot.core.Extension;
16 import com.tonbeller.jpivot.olap.model.Hierarchy;
17 import com.tonbeller.jpivot.olap.model.Member;
18
19 /**
20  * exposes parent/child relationship between members.
21  * Allows members to be displayed in a tree style GUI.
22  * Implementations will have to send metadata queries to the database.
23  * @author av
24  */

25
26 public interface MemberTree extends Extension {
27   
28   /**
29    * thrown if too many member would be returned
30    */

31   public class TooManyMembersException extends RuntimeException JavaDoc {
32     public TooManyMembersException() {
33       super();
34     }
35     public TooManyMembersException(Throwable JavaDoc cause) {
36       super(cause);
37     }
38 }
39   
40   /**
41    * name of the Extension for lookup
42    */

43   public static final String JavaDoc ID = "memberTree";
44   
45   /**
46    * @return the root members of a hierarchy. This is for example
47    * the "All" member or the list of measures.
48    */

49   Member[] getRootMembers(Hierarchy hier) throws TooManyMembersException;
50   
51   /**
52    * @return true if the member can be expanded
53    */

54   boolean hasChildren(Member member);
55   
56   /**
57    * @return the children of the member
58    */

59   Member[] getChildren(Member member) throws TooManyMembersException;
60   
61   /**
62    * @return the parent of member or null, if this is a root member
63    */

64   Member getParent(Member member);
65 }
66
Popular Tags