home *** CD-ROM | disk | FTP | other *** search
- package BsscXML;
-
- import java.util.Hashtable;
- import java.util.Vector;
-
- public class BsscXMLElement implements IBsscXMLElementBuilder, IBsscXMLElementReader {
- private BsscXMLElement m_oParent = null;
- private Vector m_vChildren = null;
- private Hashtable m_hAttr = null;
- private String m_sValue = null;
- private String m_sName = null;
-
- public int findChild(IBsscXMLElementReader var1) {
- return var1 instanceof BsscXMLElement ? this.m_vChildren.indexOf((BsscXMLElement)var1) : -1;
- }
-
- public IBsscXMLElementReader getChild(int var1) {
- IBsscXMLElementReader var2 = null;
-
- try {
- var2 = (IBsscXMLElementReader)this.m_vChildren.elementAt(var1);
- } catch (ArrayIndexOutOfBoundsException var3) {
- }
-
- return var2;
- }
-
- public void setAttribute(String var1, String var2) {
- this.m_hAttr.put(var1, var2);
- }
-
- public void setValue(String var1) {
- this.m_sValue = var1;
- }
-
- public String getValue() {
- return this.m_sValue;
- }
-
- public String getAttribute(String var1) {
- return (String)this.m_hAttr.get(var1);
- }
-
- public IBsscXMLElementReader getNextSibling() {
- if (this.m_oParent != null) {
- int var1 = this.m_oParent.findChild(this.m_oParent);
- return this.m_oParent.getChild(var1 + 1);
- } else {
- return null;
- }
- }
-
- public void setParent(IBsscXMLElementBuilder var1) throws BsscXMLException {
- if (var1 instanceof BsscXMLElement) {
- if (this.m_oParent == null) {
- this.m_oParent = (BsscXMLElement)var1;
- } else {
- throw new BsscXMLException("Internal Error!");
- }
- } else {
- throw new BsscXMLException("Type Mismatch!");
- }
- }
-
- public IBsscXMLElementReader getParent() {
- return this.m_oParent;
- }
-
- public BsscXMLElement(String var1) {
- this.m_sName = var1;
- this.m_vChildren = new Vector();
- this.m_hAttr = new Hashtable();
- this.m_sValue = "";
- }
-
- public IBsscXMLElementReader getPrevSibling() {
- if (this.m_oParent != null) {
- int var1 = this.m_oParent.findChild(this.m_oParent);
- return this.m_oParent.getChild(var1 - 1);
- } else {
- return null;
- }
- }
-
- public boolean checkName(String var1) {
- return var1 != null && var1.length() != 0 ? var1.equals(this.m_sName) : true;
- }
-
- public void addChild(IBsscXMLElementBuilder var1) throws BsscXMLException {
- if (var1 instanceof BsscXMLElement) {
- this.m_vChildren.addElement((BsscXMLElement)var1);
- } else {
- throw new BsscXMLException("Type Mismatch!");
- }
- }
-
- public String getName() {
- return this.m_sName;
- }
- }
-