Java Code Examples for org.olap4j.metadata.Member#getChildMemberCount()
The following examples show how to use
org.olap4j.metadata.Member#getChildMemberCount() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NodeFilter.java From Knowage-Server with GNU Affero General Public License v3.0 | 6 votes |
public NodeFilter(Member m) throws OlapException { super(); this.id = m.getUniqueName(); this.uniqueName = m.getUniqueName(); this.name = m.getCaption(); this.visible = false; this.collapsed = false; this.children = new HashSet<NodeFilter>(); this.leaf = m.getChildMemberCount() == 0; if (m != null) { List<Member> list = (List<Member>) m.getChildMembers(); if (list != null && list.size() > 0) { for (int i = 0; i < list.size(); i++) { NodeFilter nf = new NodeFilter(list.get(i)); children.add(nf); } } } }
Example 2
Source File: CubeUtilities.java From Knowage-Server with GNU Affero General Public License v3.0 | 6 votes |
public static long getLeafs(Member member) throws OlapException { NamedList list = member.getProperties(); Long leafs = (Long) member.getPropertyValue(WhatIfConstants.MEMBER_PROPERTY_LEAF); if (leafs != null) { return leafs; } else { leafs = 0l; } if (member.getChildMemberCount() == 0) { return 1l; } NamedList children = member.getChildMembers(); for (int i = 0; i < children.size(); i++) { Member aChild = (Member) children.get(i); leafs = leafs + getLeafs(aChild); } member.setProperty(WhatIfConstants.MEMBER_PROPERTY_LEAF, leafs); return leafs; }
Example 3
Source File: SbiMember.java From Knowage-Server with GNU Affero General Public License v3.0 | 5 votes |
public SbiMember(Member member, boolean visible, String description) { this.uniqueName = member.getUniqueName(); this.id = member.getUniqueName(); this.name = member.getCaption(); this.text = calculateText(member.getName(), member.getCaption()); try { this.leaf = member.getChildMemberCount() == 0; } catch (OlapException e) { throw new SpagoBIEngineRuntimeException("Error getting the childs count for the member " + member.getUniqueName(), e); } this.visible = visible; this.qtip = description; }
Example 4
Source File: NodeFilter.java From Knowage-Server with GNU Affero General Public License v3.0 | 4 votes |
public NodeFilter(Member m, int depth, Set<Member> leaves, Set<Member> visibleMembers, boolean showSiblings) throws OlapException { super(); if (visibleMembers != null && visibleMembers.contains(m)) { this.visible = true; visibleMembers.remove(m); } else { this.visible = false; } this.id = m.getUniqueName(); this.uniqueName = m.getUniqueName(); this.name = m.getCaption(); this.collapsed = false; this.children = new TreeSet<NodeFilter>(); this.leaf = m.getChildMemberCount() == 0; int curDepth = m.getDepth(); if (curDepth <= depth && !leaves.isEmpty()) { for (Member member : m.getChildMembers()) { if (isPotentialChild(leaves, member)) { this.collapsed = true; if (showSiblings && leaves.contains(member)) { for (Member member2 : m.getChildMembers()) { children.add(new NodeFilter(member2, depth, leaves, visibleMembers, showSiblings)); } break; } else { children.add(new NodeFilter(member, depth, leaves, visibleMembers, showSiblings)); } leaves.remove(member); } } } }