1 28 package net.sf.jasperreports.olap.mondrian; 29 30 import mondrian.olap.Hierarchy; 31 import mondrian.olap.Level; 32 import net.sf.jasperreports.olap.result.JROlapHierarchy; 33 import net.sf.jasperreports.olap.result.JROlapHierarchyLevel; 34 35 36 40 public class JRMondrianHierarchy implements JROlapHierarchy 41 { 42 43 private final Hierarchy hierarchy; 44 private final JRMondrianLevel[] levels; 45 46 public JRMondrianHierarchy(Hierarchy hierarchy) 47 { 48 this.hierarchy = hierarchy; 49 50 Level[] hierarchyLevels = hierarchy.getLevels(); 51 levels = new JRMondrianLevel[hierarchyLevels.length]; 52 for (int i = 0; i < hierarchyLevels.length; i++) 53 { 54 levels[i] = new JRMondrianLevel(hierarchyLevels[i]); 55 } 56 } 57 58 public String getDimensionName() 59 { 60 return hierarchy.getDimension().getName(); 61 } 62 63 public JROlapHierarchyLevel[] getLevels() 64 { 65 return levels; 66 } 67 68 } 69 | Popular Tags |