package com.treelight.krnl; import java.util.LinkedList; /** * A list of structure nodes. * * @version 0.1 * @author Eric Armstrong * @see ../NodesAndLists.html */ public abstract class StructureList extends AbstractList { static final String type = STRUCTURE_LIST; private LinkedList list = new LinkedList(); public void add(StructureNode node) list.add(node); } public void remove(StructureNode targetNode) throws ItemNotFoundException { Iterator lit = list.listIterator(); while (lit.hasNext()) { StructureNode currNode = (StructureNode) lit.next(); if (currNode.equals(targetNode)) { lit.remove(); return; // successful } } throw new ItemNotFoundException(); } public StructureNode get(int n) { return (StructureNode) list.get(n); } public void replace(int n, StructureNode node) { // ___TODO___ } }//StructureList