|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.palo.api.impl.HierarchyImpl
public class HierarchyImpl
TODO DOCUMENT ME
| 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. |
Subset |
addSubset(java.lang.String name)
Adds a new Subset with the given name to the hierarchy. |
boolean |
canBeModified()
Returns true if this object can be modified (renamed, deleted, ...), false otherwise. |
boolean |
canCreateChildren()
Returns true if this object can create child objects, false otherwise. |
boolean |
equals(java.lang.Object other)
|
ElementNode[] |
getAllElementNodes()
Returns an array of all element nodes of the consolidation hierarchy of this hierarchy. |
Attribute |
getAttribute(java.lang.String attrId)
Returns the Attribute which corresponds to the given id or
null if no Attribute with this id exists |
Attribute |
getAttributeByName(java.lang.String attrName)
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 Attributes this hierarchy has. |
java.lang.Object[] |
getAttributeValues(Attribute[] attributes,
Element[] elements)
Convenient method to receive the values from several Attributes 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 Elements 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. |
java.lang.String |
getId()
Returns the unique identifier of this palo object. |
int |
getMaxDepth()
Returns the maximum depth of this hierarchy. |
int |
getMaxLevel()
Returns the maximum level of this hierarchy. |
java.lang.String |
getName()
Returns the name of the entity. |
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 |
int |
getType()
TODO please comment :) |
int |
hashCode()
|
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 |
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 Elements 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 Attributes
at once, i.e. the i.th value is assigned to the i.th attribute for the
i.th element. |
java.lang.String |
toString()
|
void |
visitElementTree(ElementNodeVisitor visitor)
Visits the element-tree of this hierarchy. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public java.lang.String getId()
PaloObjectImportant note: for a correct usage please note that the returned id is only unique within the parent scope of this palo object. Furthermore in case of deletion the id is reused, i.e. if a palo object is removed its id could be given to a newly created palo object afterwards!!
getId in interface PaloObjectpublic java.lang.String getName()
NamedEntity
getName in interface NamedEntitypublic boolean isNormal()
Hierarchy
isNormal in interface Hierarchypublic void rename(java.lang.String name)
Hierarchy
rename in interface Hierarchyname - the the name for the hierarchy.public boolean canBeModified()
Writable
canBeModified in interface Writablepublic boolean canCreateChildren()
Writable
canCreateChildren in interface Writablepublic int getType()
PaloObject
getType in interface PaloObjectpublic Dimension getDimension()
Hierarchy
getDimension in interface Hierarchypublic int getElementCount()
HierarchyElements of this instance.
Note that a single hierarchy with consolidated elements might
consolidate a particular element more than once.
getElementCount in interface HierarchyElements of this instance.public final Element[] getElements()
HierarchyElement 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.
getElements in interface HierarchyElement instances available
for this Hierarchy.public final Element getElementAt(int index)
HierarchyElement 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.
getElementAt in interface Hierarchyindex - the index
Element stored at the given index
or null.public final ElementNode[] getAllElementNodes()
Hierarchy
getAllElementNodes in interface Hierarchypublic final Attribute addAttribute(java.lang.String name)
HierarchyAttribute 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.
addAttribute in interface Hierarchyname - the name of the new attribute
Attributepublic final void removeAllAttributes()
Hierarchy
removeAllAttributes in interface Hierarchypublic final void removeAttribute(Attribute attribute)
HierarchyAttribute from the hierarchy
removeAttribute in interface Hierarchyattribute - the attribute instance to removepublic final Attribute[] getAttributes()
HierarchyAttributes this hierarchy has.
getAttributes in interface HierarchyAttributes of this hierarchypublic final Attribute getAttribute(java.lang.String attrId)
HierarchyAttribute which corresponds to the given id or
null if no Attribute with this id exists
getAttribute in interface HierarchyattrId - identifier of the Attribute to get
Attribute or nullpublic final Attribute getAttributeByName(java.lang.String attrName)
HierarchyAttribute which corresponds to the given name or
null if no Attribute with this name exists
getAttributeByName in interface HierarchyattrName - the name of the Attribute to get
Attribute or null
public final java.lang.Object[] getAttributeValues(Attribute[] attributes,
Element[] elements)
HierarchyAttributes 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.
getAttributeValues in interface Hierarchyattributes - the attributes to get the values fromelements - the effected elements
public final Cube getAttributeCube()
HierarchyCube 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!!
getAttributeCube in interface Hierarchy
public final void setAttributeValues(Attribute[] attributes,
Element[] elements,
java.lang.Object[] values)
HierarchyAttributes
at once, i.e. the i.th value is assigned to the i.th attribute for the
i.th element.PaloAPIException is thrown.
setAttributeValues in interface Hierarchyattributes - the attributes to set the values forelements - the effected elementsvalues - the new valuespublic final Hierarchy getAttributeHierarchy()
HierarchyHierarchy 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!!
getAttributeHierarchy in interface Hierarchy
public final Element addElement(java.lang.String name,
int type)
HierarchyElement to this Hierarchy.
addElement in interface Hierarchyname - the name of the element to add.type - the type of the element to add as defined by the constants
in the Element class.
public final void addElements(java.lang.String[] names,
int[] types)
Hierarchy
addElements in interface Hierarchynames - the names of the elements to add.types - the types of the elements to add.public final ElementNode[] getElementsTree()
Hierarchy
getElementsTree in interface Hierarchypublic final Element[] getRootElements()
Hierarchy
getRootElements in interface Hierarchypublic final void visitElementTree(ElementNodeVisitor visitor)
Hierarchy
visitElementTree in interface Hierarchyvisitor - the visitor-callback to invoke
during traversal.public final void removeElements(Element[] elements)
HierarchyElements from this Hierarchy
removeElements in interface Hierarchyelements - Elements to remove.public final Element getElementById(java.lang.String id)
HierarchyElement stored under the given id or
null if no such Element exists.
getElementById in interface Hierarchyid - the element-id to look-up.
Element stored under the given id or
null if no such Element exists.public final Element getElementByName(java.lang.String name)
HierarchyElement stored under the given name or
null if no such Element exists.
getElementByName in interface Hierarchyname - the element-name to look-up.
Element stored under the given name or
null if no such Element exists.public final java.lang.String[] getElementNames()
HierarchyHierarchy.
The returned array is a copy of the internal data structure. Changing the returned array does not change this instance.
getElementNames in interface HierarchyElements instances available
for this Dimension>.
public final void renameElement(Element element,
java.lang.String newName)
HierarchyElement.
renameElement in interface Hierarchyelement - the Element to rename.newName - the new name for this Element.public final Element[] getElementsInOrder()
Hierarchy
getElementsInOrder in interface Hierarchy
public final Consolidation newConsolidation(Element element,
Element parent,
double weight)
HierarchyConsolidation for later use in this hierarchy.
newConsolidation in interface Hierarchyelement - the Element to consolidate.parent - the parent-Element of the consolidation.weight - the consolidation weight.
Consolidation object.public final void removeElement(Element element)
HierarchyElement from this Hierarchy
removeElement in interface Hierarchyelement - the Element to remove.public final int getMaxDepth()
HierarchyElement.getDepth() for an explanation of how the depth is
determined
getMaxDepth in interface Hierarchypublic final int getMaxLevel()
HierarchyElement.getLevel() for an explanation of how the level is
determined
getMaxLevel in interface Hierarchypublic final boolean isAttributeHierarchy()
HierarchyHierarchy is an attribute hierarchy, i.e.
its elements represent Attributes.
isAttributeHierarchy in interface Hierarchypublic final boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic final int hashCode()
hashCode in class java.lang.Objectpublic Subset addSubset(java.lang.String name)
HierarchySubset with the given name to the hierarchy.
addSubset in interface Hierarchyname - the name of the subset
public Subset getSubset(java.lang.String id)
Hierarchy
getSubset in interface Hierarchyid - the subset id
public SubsetHandler getSubsetHandler()
HierarchySubsetHandler for managing the new subsets.
Please use Database.supportsNewSubsets() to check if new
subsets are supported.
getSubsetHandler in interface HierarchySubsetHandler for managing new subsetspublic Subset[] getSubsets()
Hierarchy
getSubsets in interface Hierarchypublic void removeSubset(Subset subset)
Hierarchy
removeSubset in interface Hierarchysubset - the subset to removepublic final boolean isSubsetHierarchy()
HierarchyHierarchy is a subset hierarchy, i.e.
its elements represent Subsets.
isSubsetHierarchy in interface Hierarchypublic final java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||