OME
Interface OMEElement

All Known Subinterfaces:
ModelElement, ViewElement

public interface OMEElement
extends OMEObject

This interface extend the OMEObject interface to include the characteristics specific to elements. These characterictics specifically include the following

  • elements may have a parent
  • elements may have children
  • elements may be expandable


    Method Summary
     void addChild(OMEElement child)
              Adds a child to an expandable element.
     java.util.Collection getChildren()
              Returns a collection of OMEElements in the expandable bounds of this OMEElement.
     OMEElement getParent()
              Returns the element's parent.
     boolean isExpandable()
              Returns whether element is expandable.
     void removeChild(OMEElement child)
              Removes a child from this (expandable) element.
     void setExpandable(boolean e)
              Sets whether this element is expandable.
     void setParent(OMEElement parent)
              Changes or sets the parent of the element.
     
    Methods inherited from interface OME.OMEObject
    addLink, getComment, getID, getLinks, getModel, getName, getType, setComment, setID, setName, setType
     

    Method Detail

    getParent

    public OMEElement getParent()
    Returns the element's parent. If it does not have a parent, null is returned

    setParent

    public void setParent(OMEElement parent)
                   throws java.lang.Exception
    Changes or sets the parent of the element. If this is attempted on an expandable element an error will be thrown. Both this method, and the parent's addChild() method must be called to add a child to a parent.
    Parameters:
    parent - the OMEElement whom we set as the parent of of this OMEElement.

    addChild

    public void addChild(OMEElement child)
                  throws java.lang.Exception
    Adds a child to an expandable element. If attempted on a non-expandable element, an error will be thrown. Both this method and the child's setparent method must be called to add a child to a parent.
    Parameters:
    child - the OMEElement which we are adding to this expandanble OMEElement.

    removeChild

    public void removeChild(OMEElement child)
                     throws java.lang.Exception
    Removes a child from this (expandable) element. If attempted on a non-expandable element, or if the child is not in fact a child of the parent, and exception is thrown. A call must also be made to child.setParent(null) to remove the child from its parent.

    isExpandable

    public boolean isExpandable()
    Returns whether element is expandable.
    Returns:
    true if this OMEElement is expandable and false otherwise.

    setExpandable

    public void setExpandable(boolean e)
                       throws java.lang.Exception
    Sets whether this element is expandable. If this is attempted on an element with children, or with a parent, then an error will be thrown if the new state does not allow children or a parent respectively. e the boolean value denoting the new expandable status of this OMEElement

    getChildren

    public java.util.Collection getChildren()
    Returns a collection of OMEElements in the expandable bounds of this OMEElement. This collection is writable.