Created
November 21, 2013 11:52
-
-
Save maxisoft/7580308 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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