/**
* Implementation of the {@link Node} interface.
- *
+ *
* @author David ‘Bombe’ Roden <bombe@freenetproject.org>
* @param <E>
* The type of the element to store
/**
* Creates a new node with the given parent and element.
- *
+ *
* @param parentNode
* The parent of this node
* @param element
* {@inheritDoc}
*/
public Node<E> getChild(E element) {
- for (Node<E> childNode: children) {
+ for (Node<E> childNode : children) {
if (childNode.getElement().equals(element)) {
return childNode;
}
* {@inheritDoc}
*/
public boolean hasChild(E element) {
- for (Node<E> childNode: children) {
+ for (Node<E> childNode : children) {
if (childNode.getElement().equals(element)) {
return true;
}
*/
public int getIndexOfChild(Node<E> childNode) {
int childIndex = 0;
- for (Node<E> node: children) {
+ for (Node<E> node : children) {
if (node.equals(childNode)) {
return childIndex;
}
*/
public int getIndexOfChild(E element) {
int childIndex = 0;
- for (Node<E> node: children) {
+ for (Node<E> node : children) {
if (node.getElement().equals(element)) {
return childIndex;
}
* {@inheritDoc}
*/
public void removeChild(E child) {
- for (Node<E> childNode: children) {
+ for (Node<E> childNode : children) {
if (child.equals(childNode.getElement())) {
children.remove(childNode);
break;
* {@inheritDoc}
*/
public Node<E> findChild(E element) {
- for (Node<E> childNode: children) {
+ for (Node<E> childNode : children) {
Node<E> wantedNode = childNode.findChild(element);
if (wantedNode != null) {
return wantedNode;