
com.github.kdvolder.tttree.TTTreeVisitor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of two-three-tree Show documentation
Show all versions of two-three-tree Show documentation
Two-Three Tree implementation
package com.github.kdvolder.tttree;
public class TTTreeVisitor, V> {
/**
* Visit empty tree.
*/
public void visit_empty() {}
/**
* Visit a leaf
*/
public void visit_leaf(K k, V v) {}
public void visit_2node(TTTree l, K k, TTTree r) {
enter_2node(l, k, r);
l.accept(this);
r.accept(this);
exit_2node(l, k, r);
}
/**
* Visit a 3 node
*/
public void visit_3node(TTTree l, K k1, TTTree m, K k2, TTTree r) {
enter_3node(l, k1, m, k2, r);
l.accept(this);
visit_internal_key(k1);
m.accept(this);
visit_internal_key(k2);
r.accept(this);
exit_3node(l, k1, m, k2, r);
}
public void visit_internal_key(K k) {}
public void exit_3node(TTTree l, K k1, TTTree m, K k2, TTTree r) {}
public void enter_3node(TTTree l, K k1, TTTree m, K k2, TTTree r) {}
public void enter_2node(TTTree l, K k, TTTree r) {}
public void exit_2node(TTTree l, K k, TTTree r) {}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy