org.palo.api
Interface Element

All Superinterfaces:
NamedEntity, PaloObject, Writable

public interface Element
extends PaloObject

Element.

Elements belong to Dimensions. A dimension is the parent of several distinct Elements. HOwever if an Element is consolidated more than once in a specific dimension than traversing the children of all elements will encounter a given element multiple times.

Within the scope of its single parent Dimension, a dimension is uniquely identified by its name as returned by getName().

Version:
$ID$
See Also:
PaloAPIException

Field Summary
static int ELEMENTTYPE_CONSOLIDATED
          Identifier as returned by getType() that identifies consolidated elements.
static java.lang.String ELEMENTTYPE_CONSOLIDATED_STRING
          String constant mapped to the element-type ELEMENTTYPE_CONSOLIDATED.
static int ELEMENTTYPE_NUMERIC
          Identifier as returned by getType() that identifies numeric elements.
static java.lang.String ELEMENTTYPE_NUMERIC_STRING
          String constant mapped to the element-type ELEMENTTYPE_NUMERIC.
static int ELEMENTTYPE_RULE
          Identifier as returned by getType() that identifies rule elements.
static java.lang.String ELEMENTTYPE_RULE_STRING
          String constant mapped to the element-type ELEMENTTYPE_RULE.
static int ELEMENTTYPE_STRING
          Identifier as returned by getType() that identifies string elements.
static java.lang.String ELEMENTTYPE_STRING_STRING
          String constant mapped to the element-type ELEMENTTYPE_STRING.
 
Fields inherited from interface org.palo.api.PaloObject
TYPE_ATTRIBUTE, TYPE_NORMAL, TYPE_SYSTEM, TYPE_USER_INFO
 
Method Summary
 java.lang.Object getAttributeValue(Attribute attribute)
          Returns the value of the specified Attribute
 java.lang.Object[] getAttributeValues()
          Returns the values of all Attributes currently registered with this element
 int getChildCount()
          Returns the number of child-elements in the consolidation-hierarchy.
 Element[] getChildren()
          Returns the child-elements in the consolidation-hierarchy.
 Consolidation getConsolidationAt(int index)
          Returns the Consolidation stored at the given index.
 int getConsolidationCount()
          Returns the number of Consolidations of this instance.
 Consolidation[] getConsolidations()
          Returns an array of Consolidation instances available for this instance.
 int getDepth()
          The depth describes how deep the element is located inside its dimension hierarchy related to its root elements, i.e. the depth is the length of the longest path which starts from the root elements and ends in this element.
 Dimension getDimension()
          Deprecated. use getHierarchy() instead.
 Hierarchy getHierarchy()
          Returns the parent Hierarchy of this instance.
 int getLevel()
          The level describes how high the element is located inside its dimension hierarchy related to its base-elements.
 java.lang.String getName()
          Returns the name of this Element
 int getParentCount()
          Returns the number of parent-elements in the consolidation-hierarchy.
 Element[] getParents()
          Returns the parent-elements in the consolidation-hierarchy.
 int getPosition()
          Returns the position of this element within its dimension
 int getType()
          Returns the type of this Element, one of the following is returned: ELEMENTTYPE_NUMERIC ELEMENTTYPE_STRING ELEMENTTYPE_CONSOLIDATED ELEMENTTYPE_RULE
 java.lang.String getTypeAsString()
          Returns a string description of the Element's type.
 void move(int newPosition)
          Moves this element to the given position in its dimension
 void rename(java.lang.String name)
          Renames this Element.
 void setAttributeValue(Attribute attribute, java.lang.Object value)
          Sets the value for the given Attribute instance
 void setAttributeValues(Attribute[] attributes, java.lang.Object[] values)
          Sets the values for the given Attribute instances
 void setType(int type)
           
 void updateConsolidations(Consolidation[] consolidations)
          Updates the consolidation-infos of this Element.
 
Methods inherited from interface org.palo.api.PaloObject
getId
 
Methods inherited from interface org.palo.api.Writable
canBeModified, canCreateChildren
 

Field Detail

ELEMENTTYPE_NUMERIC

static final int ELEMENTTYPE_NUMERIC
Identifier as returned by getType() that identifies numeric elements.

See Also:
Constant Field Values

ELEMENTTYPE_STRING

static final int ELEMENTTYPE_STRING
Identifier as returned by getType() that identifies string elements.

See Also:
Constant Field Values

ELEMENTTYPE_CONSOLIDATED

static final int ELEMENTTYPE_CONSOLIDATED
Identifier as returned by getType() that identifies consolidated elements.

See Also:
Constant Field Values

ELEMENTTYPE_RULE

static final int ELEMENTTYPE_RULE
Identifier as returned by getType() that identifies rule elements.

See Also:
Constant Field Values

ELEMENTTYPE_NUMERIC_STRING

static final java.lang.String ELEMENTTYPE_NUMERIC_STRING
String constant mapped to the element-type ELEMENTTYPE_NUMERIC.

See Also:
Constant Field Values

ELEMENTTYPE_STRING_STRING

static final java.lang.String ELEMENTTYPE_STRING_STRING
String constant mapped to the element-type ELEMENTTYPE_STRING.

See Also:
Constant Field Values

ELEMENTTYPE_CONSOLIDATED_STRING

static final java.lang.String ELEMENTTYPE_CONSOLIDATED_STRING
String constant mapped to the element-type ELEMENTTYPE_CONSOLIDATED.

See Also:
Constant Field Values

ELEMENTTYPE_RULE_STRING

static final java.lang.String ELEMENTTYPE_RULE_STRING
String constant mapped to the element-type ELEMENTTYPE_RULE.

See Also:
Constant Field Values
Method Detail

getName

java.lang.String getName()
Returns the name of this Element

Specified by:
getName in interface NamedEntity
Returns:
the name of this Element.

getDimension

Dimension getDimension()
Deprecated. use getHierarchy() instead.

Returns the parent Dimension of this instance.

Returns:
the parent Dimension of this instance.

getHierarchy

Hierarchy getHierarchy()
Returns the parent Hierarchy of this instance.

Returns:
the parent Hierarchy of this instance.

getType

int getType()
Returns the type of this Element, one of the following is returned:

Specified by:
getType in interface PaloObject
Returns:
the type of this Element.

setType

void setType(int type)

getTypeAsString

java.lang.String getTypeAsString()
Returns a string description of the Element's type. The returned value is a mere description only and is not to be used as a basis for comparisions and the like.

Returns:
a string description of the Element's type.

getDepth

int getDepth()
The depth describes how deep the element is located inside its dimension hierarchy related to its root elements, i.e. the depth is the length of the longest path which starts from the root elements and ends in this element. A root element is an element without any parents and its depth is 0 by definition.

Returns:
element depth

getLevel

int getLevel()
The level describes how high the element is located inside its dimension hierarchy related to its base-elements. Base-elements are elements without any children. Therefore the level is the length of the longest path which starts from the base-elements and ends in this element. The level of base-elements is 0 by definition.

Returns:
element level

rename

void rename(java.lang.String name)
Renames this Element.

Parameters:
name - the new name for this Element.

getConsolidationCount

int getConsolidationCount()
Returns the number of Consolidations of this instance. If this Element is not consolidated as returned by getType() then 0 is returned.

Returns:
the number of Consolidations of this instance.

getConsolidationAt

Consolidation getConsolidationAt(int index)
Returns the Consolidation stored at the given index. If the index does not correspond to a legal position in the internally managed array of consolidations of this instance, then null is returned.

Parameters:
index - the index
Returns:
the Consolidation stored at the given index or null.

getConsolidations

Consolidation[] getConsolidations()
Returns an array of Consolidation instances available for this instance. If this Element is not consolidated as returned by getType() then 0 is returned.

The returned array is a copy of the internal datastructure. Changing the returned array does not change this instance.

Returns:
an array of Consolidation instances available for this connection.

updateConsolidations

void updateConsolidations(Consolidation[] consolidations)
Updates the consolidation-infos of this Element.
Note: it is required to call Dimension.reload(boolean) or Hierarchy.reload(boolean) afterwards to reflect the structure changes. This separation is done to allow multiple updates of element consolidations and to reload structure only once.

Parameters:
consolidations - the consolidations to use for this Element.

getParentCount

int getParentCount()
Returns the number of parent-elements in the consolidation-hierarchy.

Returns:
the number of parent-elements in the consolidation-hierarchy.

getParents

Element[] getParents()
Returns the parent-elements in the consolidation-hierarchy.

Returns:
the parent-elements in the consolidation-hierarchy.

getChildCount

int getChildCount()
Returns the number of child-elements in the consolidation-hierarchy.

Returns:
the number of child-elements in the consolidation-hierarchy.

getChildren

Element[] getChildren()
Returns the child-elements in the consolidation-hierarchy.

Returns:
the child-elements in the consolidation-hierarchy.

getPosition

int getPosition()
Returns the position of this element within its dimension

Returns:
the element position

move

void move(int newPosition)
Moves this element to the given position in its dimension

Parameters:
newPosition -

getAttributeValue

java.lang.Object getAttributeValue(Attribute attribute)
Returns the value of the specified Attribute

Parameters:
attribute - the Attribute instance to get the value from
Returns:
the attribute value

getAttributeValues

java.lang.Object[] getAttributeValues()
Returns the values of all Attributes currently registered with this element

Returns:
an array of attribute values

setAttributeValue

void setAttributeValue(Attribute attribute,
                       java.lang.Object value)
Sets the value for the given Attribute instance

Parameters:
attribute - the Attribute to set the value of
value - the new attribute value

setAttributeValues

void setAttributeValues(Attribute[] attributes,
                        java.lang.Object[] values)
Sets the values for the given Attribute instances

Parameters:
attributes - the Attributes to set the values of
values - the new attribute values