projects
/
jSite2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add getChild(E)
[jSite2.git]
/
src
/
net
/
pterodactylus
/
util
/
data
/
NodeImpl.java
diff --git
a/src/net/pterodactylus/util/data/NodeImpl.java
b/src/net/pterodactylus/util/data/NodeImpl.java
index
5c04aee
..
785fa1f
100644
(file)
--- a/
src/net/pterodactylus/util/data/NodeImpl.java
+++ b/
src/net/pterodactylus/util/data/NodeImpl.java
@@
-87,6
+87,18
@@
class NodeImpl<E> implements Node<E> {
/**
* {@inheritDoc}
*/
/**
* {@inheritDoc}
*/
+ public Node<E> getChild(E element) {
+ for (Node<E> childNode: children) {
+ if (childNode.getElement().equals(element)) {
+ return childNode;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public boolean hasChild(Node<E> childNode) {
return children.contains(childNode);
}
public boolean hasChild(Node<E> childNode) {
return children.contains(childNode);
}