Skip to content

Instantly share code, notes, and snippets.

@maxisoft
Created November 21, 2013 11:52
Show Gist options
  • Save maxisoft/7580308 to your computer and use it in GitHub Desktop.
Save maxisoft/7580308 to your computer and use it in GitHub Desktop.
package fr.ufc.l3info.mcoo.statecharts.utils;
import java.util.ArrayList;
import java.util.List;
public class OldTree<T>{
private List<OldTree<T>> children = new ArrayList<OldTree<T>>();
private OldTree<T> parent;
private T value;
public OldTree(final OldTree<T> parent, final T value) {
this.parent = parent;
this.value = value;
}
public List<OldTree<T>> getChildren() {
return children;
}
public OldTree<T> getParent() {
return parent;
}
public T getValue() {
return value;
}
void setValue(T value){
this.value = value;
}
void reset(){
this.children.clear();
}
public boolean isLeaf(){
return this.children.isEmpty();
}
public boolean isRoot(){
return this.parent == null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment