com.simonstl.common
Interface StackableComponentI

All Superinterfaces:
NamedComponentI, NamingI
All Known Implementing Classes:
StackableComponent

public interface StackableComponentI
extends NamedComponentI

Abbreviated information about context - stores names, type, nothing else.

Author:
simonstl

Method Summary
 void addAtt(StackableComponentI att)
          Adds an attribute to this component.
 void addChild(StackableComponentI child)
          Adds a child component to this component.
 StackableComponentI getAtt(NamingI name)
          Returns an attribute, identified by anything conforming to NamingI
 StackableComponentI getAtt(java.lang.String NSUri, java.lang.String localName)
          Returns an attribute, identified by namespace URI and localName
 java.util.ArrayList getAttsAsList()
          Will permit easy sequential access to attribute values.
 StackableComponentI getChild(int which)
          Returns the child - identified by number - of the current element.
 int getNumAtts()
          Returns the number of attributes contained by this component.
 int getNumChildren()
          Returns the number of children (not attributes) contained by this component.
 StackableComponentI getParent()
          Returns the parent of this component
 void setParent(StackableComponentI parent)
          Sets the parent component for this component
 
Methods inherited from interface com.simonstl.common.NamedComponentI
getDiagValue, getType, setDiagValue, setType
 
Methods inherited from interface com.simonstl.common.NamingI
equals, getLocalName, getPrefix, getQName, getUri, hashCode, setLocalName, setPrefix, setQName, setUri
 

Method Detail

setParent

public void setParent(StackableComponentI parent)
Sets the parent component for this component

Parameters:
parent - the component you want to serve as the parent

getParent

public StackableComponentI getParent()
Returns the parent of this component

Returns:
the parent component of this component

addChild

public void addChild(StackableComponentI child)
Adds a child component to this component. Not sure if I'll coerce attributes into being atts.

Parameters:
child - the component to add as a child

addAtt

public void addAtt(StackableComponentI att)
Adds an attribute to this component. The type of the component will be coerced to attribute.

Parameters:
att - the attribute

getNumChildren

public int getNumChildren()
Returns the number of children (not attributes) contained by this component.

Returns:
the number of non-attribute children.

getNumAtts

public int getNumAtts()
Returns the number of attributes contained by this component.

Returns:
the number of attributes

getChild

public StackableComponentI getChild(int which)
Returns the child - identified by number - of the current element.

Parameters:
which - the position of the component in question
Returns:
the child component or null if which is out of range.

getAtt

public StackableComponentI getAtt(java.lang.String NSUri,
                                  java.lang.String localName)
Returns an attribute, identified by namespace URI and localName

Parameters:
NSUri - the namespace URI of the attribute
localName - the local name of the attribute
Returns:
the attribute matching the URI and local name

getAtt

public StackableComponentI getAtt(NamingI name)
Returns an attribute, identified by anything conforming to NamingI

Parameters:
name - A NamingI with the same namespace URI and local name as the attribute desired.
Returns:
the attribute matching the NamingI

getAttsAsList

public java.util.ArrayList getAttsAsList()
Will permit easy sequential access to attribute values.

Returns:
an ArrayList containing the atts as StackableComponentI