com.photoviewer.client.parse
Class MemObject

java.lang.Object
  extended bycom.photoviewer.client.parse.MemObject
Direct Known Subclasses:
FileObject

public class MemObject
extends java.lang.Object

This class represents a DOM-like view of an XML element. It holds all of the information for a given node (all attribute key-value pairs) plus a list of direct m_children (which in turn hold their m_children and so on). The only information not captured is the content between element tags. This will be added later when needed.

Author:
John De Regnaucourt

Field Summary
protected  MemObject m_parent
          Parent element reference
 
Constructor Summary
MemObject()
           
 
Method Summary
 void addSubElement(FileObject subElement)
           
 java.lang.Object getAttribute(java.lang.String key)
           
 MemObject getParent()
           
 java.util.Vector getSubElements()
           
 void setAttribute(java.lang.String key, java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_parent

protected MemObject m_parent
Parent element reference

Constructor Detail

MemObject

public MemObject()
Method Detail

getParent

public MemObject getParent()
Returns:
Parent MemObject. This is always set for a given FileObject to the root. The top most object has null for its m_parent.

getSubElements

public java.util.Vector getSubElements()
Returns:
a List of child FileObject sub-elements (only set when AddToParentElement handler is used).

addSubElement

public void addSubElement(FileObject subElement)
Parameters:
subElement - Add the passed in FileObject as a child object of this FileObject.

getAttribute

public java.lang.Object getAttribute(java.lang.String key)
Parameters:
key - is the Key for an attribute on the element associated to this FileObject
Returns:
String value of the attribute associated to the passed in key.

setAttribute

public void setAttribute(java.lang.String key,
                         java.lang.Object value)
Parameters:
key - is the Key for an attribute on the element associated to this FileObject
value - is the String value to associate to the passed in key.