algorithms-sandbox/datastructures/java/src/be/brainbaking/datastructures/trees/BTreeSearchResult.java

36 lines
639 B
Java
Raw Normal View History

2018-04-03 15:50:57 +02:00
package be.brainbaking.datastructures.trees;
public class BTreeSearchResult {
2018-04-04 08:25:15 +02:00
private final Node parent;
2018-04-03 15:50:57 +02:00
private final Node node;
private final int index;
public BTreeSearchResult() {
2018-04-04 08:25:15 +02:00
this(null, -1, null);
2018-04-03 15:50:57 +02:00
}
public boolean isFound() {
return node != null;
}
2018-04-04 08:25:15 +02:00
public Node getParent() {
return parent;
}
public BTreeSearchResult(Node node, int index, Node parent) {
2018-04-03 15:50:57 +02:00
this.node = node;
2018-04-04 08:25:15 +02:00
this.parent = parent;
2018-04-03 15:50:57 +02:00
this.index = index;
}
public int getIndex() {
return index;
}
public Node getNode() {
return node;
}
}