Class ProductNodeGroup<T extends ProductNode>

All Implemented Interfaces:
Extensible
Direct Known Subclasses:
PlacemarkGroup

public class ProductNodeGroup<T extends ProductNode> extends ProductNode
A type-safe container for elements of the type ProductNode.
  • Constructor Details

    • ProductNodeGroup

      public ProductNodeGroup(String name)
      Constructs a node group with no owner and which will not take ownership of added children.
      Parameters:
      name - The group name.
      Since:
      BEAM 4.8
    • ProductNodeGroup

      public ProductNodeGroup(ProductNode owner, String name, boolean takingOverNodeOwnership)
      Constructs a node group for the given owner.
      Parameters:
      owner - The owner of the group.
      name - The group name.
      takingOverNodeOwnership - If true, child nodes will have this group as owner after adding.
  • Method Details

    • isTakingOverNodeOwnership

      public boolean isTakingOverNodeOwnership()
      Returns:
      true, if child nodes will have this group as owner after adding.
    • getNodeCount

      public int getNodeCount()
      Returns:
      The number of product nodes in this product group.
    • get

      public T get(int index)
      Parameters:
      index - The node index.
      Returns:
      The product node at the given index.
    • getNodeDisplayNames

      public String[] getNodeDisplayNames()
      Returns the display names of all products currently managed.
      Returns:
      an array containing the display names, never null, but the array can have zero length
      See Also:
    • getNodeNames

      public String[] getNodeNames()
      Returns the names of all products currently managed.
      Returns:
      an array containing the names, never null, but the array can have zero length
    • toArray

      public ProductNode[] toArray()
      Returns an array of all products currently managed.
      Returns:
      an array containing the products, never null, but the array can have zero length
    • toArray

      public T[] toArray(T[] array)
      Parameters:
      array - the array into which the elements of the list are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.
      Returns:
      an array containing the product nodes, never null, but the array can have zero length
    • indexOf

      public int indexOf(String name)
    • indexOf

      public int indexOf(T element)
    • getByDisplayName

      public T getByDisplayName(String displayName)
      Parameters:
      displayName - the display name
      Returns:
      the product node with the given display name.
    • get

      public T get(String name)
      Parameters:
      name - the name
      Returns:
      the product node with the given name or null is a node with the name is not contained in the group.
    • contains

      public boolean contains(String name)
      Tests whether a node with the given name is contained in this group.
      Parameters:
      name - the name
      Returns:
      true, if so
    • contains

      public boolean contains(T node)
      Tests whether the given product is contained in this list.
      Parameters:
      node - the node
      Returns:
      true, if so
    • add

      public boolean add(T node)
      Adds the given node to this group.
      Parameters:
      node - the node to be added, ignored if null
      Returns:
      true, if the node has been added
    • add

      public void add(int index, T node)
      Adds the given node to this group.
      Parameters:
      index - the index.
      node - the node to be added, ignored if null
    • remove

      public boolean remove(T node)
      Removes the given node from this group.
      Parameters:
      node - the node to be removed
      Returns:
      true, if the node was removed
    • removeAll

      public void removeAll()
      Removes all nodes from this group.
    • clearRemovedList

      public void clearRemovedList()
    • getRemovedNodes

      public Collection<T> getRemovedNodes()
      Gets all removed node nodes.
      Returns:
      a collection of all removed node nodes.
    • getRawStorageSize

      public long getRawStorageSize(ProductSubsetDef subsetDef)
      Description copied from class: ProductNode
      Gets an estimated, raw storage size in bytes of this product node.
      Specified by:
      getRawStorageSize in class ProductNode
      Parameters:
      subsetDef - if not null the subset may limit the size returned
      Returns:
      the size in bytes.
    • setModified

      public void setModified(boolean modified)
      Description copied from class: ProductNode
      Sets this node's modified flag.

      If the modified flag changes to true and this node has an owner, the owner's modified flag is also set to true.

      Overrides:
      setModified in class ProductNode
      Parameters:
      modified - whether or not this node is beeing marked as modified.
      See Also:
    • acceptVisitor

      public void acceptVisitor(ProductVisitor visitor)
      Description copied from class: ProductNode
      Accepts the given visitor. This method implements the well known 'Visitor' design pattern of the gang-of-four. The visitor pattern allows to define new operations on the product data model without the need to add more code to it. The new operation is implemented by the visitor.
      Specified by:
      acceptVisitor in class ProductNode
      Parameters:
      visitor - the visitor
    • dispose

      public void dispose()
      Description copied from class: ProductNode
      Releases all of the resources used by this object instance and all of its owned children. Its primary use is to allow the garbage collector to perform a vanilla job.

      This method should be called only if it is for sure that this object instance will never be used again. The results of referencing an instance of this class after a call to dispose() are undefined.

      Overrides of this method should always call super.dispose(); after disposing this instance.

      Overrides:
      dispose in class ProductNode
    • updateExpression

      public void updateExpression(String oldExternalName, String newExternalName)
      Description copied from class: ProductNode
      Asks a product node to replace all occurences of and references to the node name given by oldExternalName with oldExternalName. Such references most often occur in band arithmetic expressions.
      Overrides:
      updateExpression in class ProductNode
      Parameters:
      oldExternalName - The old node name.
      newExternalName - The new node name.