Esempio n. 1
0
/*      */   public boolean equals(Object object)
/*      */   {
/* 1350 */     if (!(object instanceof XMLElement)) {
/* 1351 */       return false;
/*      */     }
/* 1353 */     XMLElement rawElement = (XMLElement)object;
/*      */     
/* 1355 */     if (!this.name.equals(rawElement.getLocalName())) {
/* 1356 */       return false;
/*      */     }
/* 1358 */     if (this.attributes.size() != rawElement.getAttributeCount()) {
/* 1359 */       return false;
/*      */     }
/* 1361 */     Enumeration<XMLAttribute> en = this.attributes.elements();
/* 1362 */     while (en.hasMoreElements()) {
/* 1363 */       XMLAttribute attr = (XMLAttribute)en.nextElement();
/*      */       
/* 1365 */       if (!rawElement.hasAttribute(attr.getName())) {
/* 1366 */         return false;
/*      */       }
/*      */       
/*      */ 
/*      */ 
/* 1371 */       String value = rawElement.getString(attr.getName(), null);
/* 1372 */       if (!attr.getValue().equals(value)) {
/* 1373 */         return false;
/*      */       }
/*      */     }
/*      */     
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/* 1381 */     if (this.children.size() != rawElement.getChildCount()) {
/* 1382 */       return false;
/*      */     }
/* 1384 */     for (int i = 0; i < this.children.size(); i++) {
/* 1385 */       XMLElement child1 = getChild(i);
/* 1386 */       XMLElement child2 = rawElement.getChild(i);
/*      */       
/* 1388 */       if (!child1.equals(child2)) {
/* 1389 */         return false;
/*      */       }
/*      */     }
/* 1392 */     return true;
/*      */   }
Esempio n. 2
0
/*      */   public void remove(String name)
/*      */   {
/* 1177 */     for (int i = 0; i < this.attributes.size(); i++) {
/* 1178 */       XMLAttribute attr = (XMLAttribute)this.attributes.elementAt(i);
/* 1179 */       if (attr.getName().equals(name)) {
/* 1180 */         this.attributes.removeElementAt(i);
/* 1181 */         return;
/*      */       }
/*      */     }
/*      */   }
Esempio n. 3
0
/*      */   private XMLAttribute findAttribute(String fullName)
/*      */   {
/*  685 */     Enumeration<XMLAttribute> en = this.attributes.elements();
/*  686 */     while (en.hasMoreElements()) {
/*  687 */       XMLAttribute attr = (XMLAttribute)en.nextElement();
/*  688 */       if (attr.getName().equals(fullName)) {
/*  689 */         return attr;
/*      */       }
/*      */     }
/*  692 */     return null;
/*      */   }