|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Hierarchy
Hierarchy
A hierarchy organizes dimensions with different element consolidations in a
cube. For Palo, different consolidations in a dimension are not allowed and
thus each hierarchy maps to exactly one dimension and they have identical
ids. If a dimension is removed, renamed or added, the mapping stays
consistent.
In xmla, a dimension can contain several hierarchies. Since
XMLA is currently read-only, hierarchies cannot be added or removed.
Field Summary |
---|
Fields inherited from interface org.palo.api.PaloObject |
---|
TYPE_ATTRIBUTE, TYPE_NORMAL, TYPE_SYSTEM, TYPE_USER_INFO |
Method Summary | |
---|---|
Attribute |
addAttribute(java.lang.String name)
Creates a new Attribute and adds it to the hierarchy. |
Element |
addElement(java.lang.String name,
int type)
Adds an Element to this Hierarchy . |
void |
addElements(java.lang.String[] names,
int[] types)
Batch adds many elements. |
void |
addElements(java.lang.String[] names,
int[] types,
Element[][] children,
double[][] weights)
Available for Palo Server version 3 and above. |
void |
addElements(java.lang.String[] names,
int type,
Element[][] children,
double[][] weights)
|
Subset |
addSubset(java.lang.String name)
Deprecated. old subsets are not supported anymore, please instead add subsets via getSubsetHandler() and its appropriate
methods |
ElementNode[] |
getAllElementNodes()
Returns an array of all element nodes of the consolidation hierarchy of this hierarchy. |
Attribute |
getAttribute(java.lang.String id)
Returns the Attribute which corresponds to the given id or
null if no Attribute with this id exists |
Attribute |
getAttributeByName(java.lang.String name)
Returns the Attribute which corresponds to the given name or
null if no Attribute with this name exists |
Cube |
getAttributeCube()
Returns the attribute Cube corresponding to this hierarchy or
null if the attribute cube couldn't be loaded or does
not exist. |
Hierarchy |
getAttributeHierarchy()
Returns the corresponding attribute Hierarchy or
null if the attribute hierarchy couldn't be loaded or does
not exist. |
Attribute[] |
getAttributes()
Returns all Attribute s this hierarchy has. |
java.lang.Object[] |
getAttributeValues(Attribute[] attributes,
Element[] elements)
Convenient method to receive the values from several Attribute s in one go, i.e. the i.th object in the returned
array is the i.th value of the i.th attribute for the i.th element. |
Dimension |
getDimension()
Returns the parent dimension of this hierarchy. |
Element |
getElementAt(int index)
Returns the Element stored at the given index. |
Element |
getElementById(java.lang.String id)
Returns the Element stored under the given id or
null if no such Element exists. |
Element |
getElementByName(java.lang.String name)
Returns the Element stored under the given name or
null if no such Element exists. |
int |
getElementCount()
Returns the number of Element s of this instance. |
java.lang.String[] |
getElementNames()
Returns the names of the elements of this Hierarchy . |
Element[] |
getElements()
Returns an array of Element instances available
for this instance. |
Element[] |
getElementsInOrder()
Returns all elements of the hierarchy in an order that is determined by the consolidation hierarchy. |
ElementNode[] |
getElementsTree()
Returns the root-nodes of the element-tree. |
int |
getMaxDepth()
Returns the maximum depth of this hierarchy. |
int |
getMaxLevel()
Returns the maximum level of this hierarchy. |
Element[] |
getRootElements()
Returns all root-elements (those without parents in the consolidation-hierarchy). |
Subset |
getSubset(java.lang.String id)
Returns the subset which is registered with the given id or null if no subset with this id could be found |
SubsetHandler |
getSubsetHandler()
Returns the SubsetHandler for managing the new subsets. |
Subset[] |
getSubsets()
Returns all subsets currently registered with this hierarchy |
boolean |
isAttributeHierarchy()
Checks if this Hierarchy is an attribute hierarchy, i.e. |
boolean |
isNormal()
Returns if this hierarchy is a normal hierarchy (as opposed to being a system hierarchy). |
boolean |
isSubsetHierarchy()
Checks if this Hierarchy is a subset hierarchy, i.e. |
Consolidation |
newConsolidation(Element element,
Element parent,
double weight)
Creates a Consolidation for later use in this hierarchy. |
void |
reload(boolean fireEvents)
Reloads the internal hierarchy structure from database. |
void |
removeAllAttributes()
Removes all attributes from the hierarchy |
void |
removeAttribute(Attribute attribute)
Removes the given Attribute from the hierarchy |
void |
removeElement(Element element)
Removes the given Element from this Hierarchy |
void |
removeElements(Element[] elements)
Removes the given Element s from this Hierarchy |
void |
removeSubset(Subset subset)
Removes the given subset from the dimension |
void |
rename(java.lang.String name)
Renames this hierarchy. |
void |
renameElement(Element element,
java.lang.String newName)
Renames given Element . |
void |
setAttributeValues(Attribute[] attributes,
Element[] elements,
java.lang.Object[] values)
Convenient method to set the values for several Attribute s
at once, i.e. the i.th value is assigned to the i.th attribute for the
i.th element. |
void |
visitElementTree(ElementNodeVisitor visitor)
Visits the element-tree of this hierarchy. |
Methods inherited from interface org.palo.api.PaloObject |
---|
getId, getType |
Methods inherited from interface org.palo.api.NamedEntity |
---|
getName |
Methods inherited from interface org.palo.api.Writable |
---|
canBeModified, canCreateChildren |
Method Detail |
---|
Dimension getDimension()
boolean isNormal()
void rename(java.lang.String name)
name
- the the name for the hierarchy.int getElementCount()
Element
s of this instance.
Note that a single hierarchy with consolidated elements might
consolidate a particular element more than once.
Element
s of this instance.Element[] getElements()
Element
instances available
for this instance.
The returned array is a copy of the internal data structure. Changing the returned array does not change this instance.
Element
instances available
for this Hierarchy
.void visitElementTree(ElementNodeVisitor visitor)
visitor
- the visitor-callback to invoke
during traversal.Element[] getRootElements()
ElementNode[] getElementsTree()
Element getElementAt(int index)
Element
stored at the given index.
If the index does not correspond to a legal position
in the internally managed array of elements of this
instance, then null
is returned.
index
- the index
Element
stored at the given index
or null
.java.lang.String[] getElementNames()
Hierarchy
.
The returned array is a copy of the internal data structure. Changing the returned array does not change this instance.
Element
s instances available
for this Dimension>
.Element getElementByName(java.lang.String name)
Element
stored under the given name or
null
if no such Element
exists.
name
- the element-name to look-up.
Element
stored under the given name or
null
if no such Element
exists.Element getElementById(java.lang.String id)
Element
stored under the given id or
null
if no such Element
exists.
id
- the element-id to look-up.
Element
stored under the given id or
null
if no such Element
exists.void addElements(java.lang.String[] names, int[] types)
names
- the names of the elements to add.types
- the types of the elements to add.void addElements(java.lang.String[] names, int type, Element[][] children, double[][] weights)
void addElements(java.lang.String[] names, int[] types, Element[][] children, double[][] weights)
names
- types
- children
- weights
- Element[] getElementsInOrder()
ElementNode[] getAllElementNodes()
Element addElement(java.lang.String name, int type)
Element
to this Hierarchy
.
name
- the name of the element to add.type
- the type of the element to add as defined by the constants
in the Element
class.void removeElement(Element element)
Element
from this Hierarchy
element
- the Element
to remove.void removeElements(Element[] elements)
Element
s from this Hierarchy
elements
- Element
s to remove.void renameElement(Element element, java.lang.String newName)
Element
.
element
- the Element
to rename.newName
- the new name for this Element
.Consolidation newConsolidation(Element element, Element parent, double weight)
Consolidation
for later use in this hierarchy.
element
- the Element
to consolidate.parent
- the parent-Element
of the consolidation.weight
- the consolidation weight.
Consolidation
object.int getMaxLevel()
Element.getLevel()
for an explanation of how the level is
determined
int getMaxDepth()
Element.getDepth()
for an explanation of how the depth is
determined
boolean isAttributeHierarchy()
Hierarchy
is an attribute hierarchy, i.e.
its elements represent Attribute
s.
boolean isSubsetHierarchy()
Hierarchy
is a subset hierarchy, i.e.
its elements represent Subset
s.
Attribute addAttribute(java.lang.String name)
Attribute
and adds it to the hierarchy.
Note: adding an attribute to a hierarchy which is itself of type
attribute hierarchy is prohibited and will result in a
PaloAPIException
.
name
- the name of the new attribute
Attribute
void removeAttribute(Attribute attribute)
Attribute
from the hierarchy
attribute
- the attribute instance to removevoid removeAllAttributes()
Attribute[] getAttributes()
Attribute
s this hierarchy has.
Attribute
s of this hierarchyAttribute getAttribute(java.lang.String id)
Attribute
which corresponds to the given id or
null
if no Attribute
with this id exists
id
- identifier of the Attribute
to get
Attribute
or null
Attribute getAttributeByName(java.lang.String name)
Attribute
which corresponds to the given name or
null
if no Attribute
with this name exists
name
- the name of the Attribute
to get
Attribute
or null
void setAttributeValues(Attribute[] attributes, Element[] elements, java.lang.Object[] values)
Attribute
s
at once, i.e. the i.th value is assigned to the i.th attribute for the
i.th element.PaloAPIException
is thrown.
attributes
- the attributes to set the values forelements
- the effected elementsvalues
- the new valuesjava.lang.Object[] getAttributeValues(Attribute[] attributes, Element[] elements)
Attribute
s in one go, i.e. the i.th object in the returned
array is the i.th value of the i.th attribute for the i.th element.PaloAPIException
is thrown.
attributes
- the attributes to get the values fromelements
- the effected elements
Cube getAttributeCube()
Cube
corresponding to this hierarchy or
null
if the attribute cube couldn't be loaded or does
not exist.
Note: this is a convenient method to provide raw access to the internal attribute handling. Its usage is not recommended!!
Hierarchy getAttributeHierarchy()
Hierarchy
or
null
if the attribute hierarchy couldn't be loaded or does
not exist.
Note: this is a convenient method to provide raw access to the internal attribute handling. Its usage is not recommended!!
Subset addSubset(java.lang.String name)
getSubsetHandler()
and its appropriate
methods
Subset
with the given name to the hierarchy.
name
- the name of the subset
void removeSubset(Subset subset)
subset
- the subset to removeSubset[] getSubsets()
Subset getSubset(java.lang.String id)
id
- the subset id
SubsetHandler getSubsetHandler()
SubsetHandler
for managing the new subsets.
Please use Database.supportsNewSubsets()
to check if new
subsets are supported.
SubsetHandler
for managing new subsetsvoid reload(boolean fireEvents)
fireEvents
- specify true
to get event notification on
hierarchy changes or false
otherwise
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |