Looks up a child by name and creates a new one if necessary.
int hash = uri.hashCode() * 31 + localName.hashCode();
int index = hash & 15;
Child current = children[index];
if (current == null) {
// We have no children in this bucket yet.
current = new Child(parent, uri, localName, parent.depth + 1, hash);
children[index] = current;
return current;
} else {
// Search this bucket.
Child previous;
do {
if (current.hash == hash
&& current.uri.compareTo(uri) == 0
&& current.localName.compareTo(localName) == 0) {
// We already have a child with that name.
return current;
}
previous = current;
current = current.next;
} while (current != null);
// Add a new child to the bucket.
current = new Child(parent, uri, localName, parent.depth + 1, hash);
previous.next = current;
return current;
}