more with method naming, add XML hasChildren() method

This commit is contained in:
benfry
2012-07-22 00:19:48 +00:00
parent c9a83e9993
commit bae7fa5243
6 changed files with 139 additions and 109 deletions

View File

@@ -72,7 +72,7 @@ public class XML implements Serializable {
this(PApplet.createReader(file));
}
public XML(Reader reader) {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
@@ -240,6 +240,12 @@ public class XML implements Serializable {
}
public boolean hasChildren() {
checkChildren();
return children.length > 0;
}
/**
* Put the names of all children into an array. Same as looping through
* each child and calling getName() on each XMLElement.