KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > jpivot > test > olap > TestMemberTree


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.test.olap;
14
15 import java.util.List JavaDoc;
16
17 import com.tonbeller.jpivot.core.ExtensionSupport;
18 import com.tonbeller.jpivot.olap.model.Hierarchy;
19 import com.tonbeller.jpivot.olap.model.Member;
20 import com.tonbeller.jpivot.olap.navi.MemberTree;
21
22 /**
23  * Created on 22.10.2002
24  *
25  * @author av
26  */

27 public class TestMemberTree extends ExtensionSupport implements MemberTree {
28
29   /**
30    * @see com.tonbeller.jpivot.olap.navi.MemberTree#getRootMembers(Hierarchy)
31    */

32   public Member[] getRootMembers(Hierarchy hier) {
33     return ((TestHierarchy)hier).getRootMembers();
34   }
35
36   /**
37    * @see com.tonbeller.jpivot.olap.navi.MemberTree#hasChildren(Member)
38    */

39   public boolean hasChildren(Member member) {
40     return ((TestMember)member).hasChildren();
41   }
42
43   /**
44    * @see com.tonbeller.jpivot.olap.navi.MemberTree#getChildren(Member)
45    */

46   public Member[] getChildren(Member member) {
47     List JavaDoc list = ((TestMember)member).getChildMember();
48     return (Member[])list.toArray(new TestMember[list.size()]);
49   }
50
51   /**
52    * @see com.tonbeller.jpivot.olap.navi.MemberTree#getParent(Member)
53    */

54   public Member getParent(Member member) {
55     return ((TestMember)member).getParentMember();
56   }
57
58 }
59
Popular Tags