| /** |
| * |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.datamart.common.olap; |
| |
| import java.util.ArrayList; |
| import java.util.List; |
| |
| public class DerivedHierarchy { |
| private org.olap4j.metadata.Hierarchy olapHierarchy; |
| private mondrian.olap.Hierarchy mondrianHierarchy; |
| |
| List<DerivedLevel> levelList = new ArrayList<DerivedLevel>(); |
| |
| public DerivedHierarchy(org.olap4j.metadata.Hierarchy olapHierarchy) { |
| this.olapHierarchy = olapHierarchy; |
| for (org.olap4j.metadata.Level olapLevel : olapHierarchy.getLevels()) { |
| levelList.add(new DerivedLevel(olapLevel)); |
| } |
| } |
| |
| public DerivedHierarchy(mondrian.olap.Hierarchy mondrianHierarchy) { |
| this.mondrianHierarchy = mondrianHierarchy; |
| for (mondrian.olap.Level mondrianLevel : mondrianHierarchy.getLevels()) { |
| levelList.add(new DerivedLevel(mondrianLevel)); |
| } |
| } |
| |
| public String getName() { |
| String name = ""; |
| if (olapHierarchy!=null){ |
| name = olapHierarchy.getName(); |
| } else if (mondrianHierarchy!=null){ |
| name = mondrianHierarchy.getName(); |
| } |
| return name; |
| } |
| |
| public List<DerivedLevel> getLevels(){ |
| return levelList; |
| |
| } |
| } |