Class AbstractEnterpriseUnit

java.lang.Object
de.calamanari.pk.composite.AbstractEnterpriseUnit
All Implemented Interfaces:
EnterpriseNode
Direct Known Subclasses:
Company, Division, Holding

public abstract class AbstractEnterpriseUnit
extends java.lang.Object
implements EnterpriseNode
Abstract Enterprise Unit is the abstract base class of the COMPOSITE implementing the interface of the component (EnterpriseNode).
Author:
Karl Eilebrecht
  • Constructor Summary

    Constructors
    Constructor Description
    AbstractEnterpriseUnit()
    Creates unit, name not set, yet
    AbstractEnterpriseUnit​(java.lang.String name)
    Creates unit of this name
  • Method Summary

    Modifier and Type Method Description
    void addChildNode​(EnterpriseNode childNode)
    Adds the given node to this unit's child nodes.
    java.util.Collection<EnterpriseNode> getChildNodes()
    Returns the nodes below this node if any.
    java.lang.String getDescription()
    Returns some descriptive text
    java.lang.String getName()
    Name of organizational unit or member
    EnterpriseNode getParentNode()
    Returns the parent of this node or null for the root element.
    boolean remove​(EnterpriseNode childNode)
    Removes the given child node from this unit's children.
    void setName​(java.lang.String name)
    Sets the unit's name
    void setParent​(AbstractEnterpriseUnit parentUnit)
    sets this unit's parent unit

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AbstractEnterpriseUnit

      public AbstractEnterpriseUnit​(java.lang.String name)
      Creates unit of this name
      Parameters:
      name - enterprise unit name
    • AbstractEnterpriseUnit

      Creates unit, name not set, yet
  • Method Details

    • setName

      public void setName​(java.lang.String name)
      Sets the unit's name
      Parameters:
      name - enterprise unit name
    • setParent

      public void setParent​(AbstractEnterpriseUnit parentUnit)
      sets this unit's parent unit
      Parameters:
      parentUnit - the owning unit
    • addChildNode

      public void addChildNode​(EnterpriseNode childNode)
      Adds the given node to this unit's child nodes.
      Parameters:
      childNode - NOT NULL
    • remove

      public boolean remove​(EnterpriseNode childNode)
      Removes the given child node from this unit's children.
      Parameters:
      childNode - dependent node
      Returns:
      true if the given node was one of this unit's child nodes and has been removed, otherwise false
    • getChildNodes

      public java.util.Collection<EnterpriseNode> getChildNodes()
      Returns the nodes below this node if any.
      Returns:
      collection of nodes, NEVER null
    • getName

      public java.lang.String getName()
      Description copied from interface: EnterpriseNode
      Name of organizational unit or member
      Specified by:
      getName in interface EnterpriseNode
      Returns:
      display name
    • getParentNode

      Description copied from interface: EnterpriseNode
      Returns the parent of this node or null for the root element.
      Specified by:
      getParentNode in interface EnterpriseNode
      Returns:
      parent node or null
    • getDescription

      public java.lang.String getDescription()
      Description copied from interface: EnterpriseNode
      Returns some descriptive text
      Specified by:
      getDescription in interface EnterpriseNode
      Returns:
      description