From bbefaad1de12cea3210593c17db6e12334eb7903 Mon Sep 17 00:00:00 2001 From: Ben Culkin Date: Fri, 16 Sep 2022 18:35:06 -0400 Subject: Adjust a few things --- src/main/java/bjc/esodata/AbbrevTree.java~ | 75 ------------------------------ 1 file changed, 75 deletions(-) delete mode 100644 src/main/java/bjc/esodata/AbbrevTree.java~ (limited to 'src/main/java/bjc/esodata/AbbrevTree.java~') diff --git a/src/main/java/bjc/esodata/AbbrevTree.java~ b/src/main/java/bjc/esodata/AbbrevTree.java~ deleted file mode 100644 index a391028..0000000 --- a/src/main/java/bjc/esodata/AbbrevTree.java~ +++ /dev/null @@ -1,75 +0,0 @@ -package bjc.esodata; - -import java.util.*; - -/** - * A labeled tree, where you can reference sub-nodes by their label as long as the reference is unambiguous. - * - * Inspired by the way that you can reference COBOL members by their name, as long as it is unambiguous. If it is ambiguous, you can instead use parent nodes to disambiguate. - * - * @param The type of data contained in the nodes. - */ -public class AbbrevTree { - /** Represents a single node in an AbbrevTree */ - public interface AbbrevNode { - /** The label for the node. */ - public String getLabel(); - /** The data for the node. */ - public Contained getData(); - /** - * Add a child to this node. - * - * If a node already exists with the given label, it will be replaced. - * - * @param label The label for the child. - * @param contained The data contained in the child. - */ - public void addChild(String label, String contained); - /** - * Get a child, starting the search from this node. - * @param labels The label(s) to search for. If the label is ambiguous, provide additional ones to make it unambiguous. - */ - public AbbrevNode getNode(String... labels); - } - - public Contained get(String... labels) { - return null; - } -} - -class AbbrevNode { - private String label; - private Contained data; - - private List> children; - private AbbrevTree container; - - /** - * Create a new AbbrevNode with a label and contents. - * @param label The label for this node. - * @param data The data contained in the node. - * @param container The tree that contains the node. - */ - public AbbrevNode(String label, Contained data, AbbrevTree container) { - this(container); - - this.label = label; - this.data = data; - } - - /** - * Get the label for this node. - * @return The label for this node. - */ - public String getLabel() { - return label; - } - - /** - * Get the data for this node. - * @return The data for this node. - */ - public Contained getData() { - return data; - } -} -- cgit v1.2.3