/* * Component.java * * Klass som lagrar komponentdata * åt parserklassen. * * Karl-Adam Karlsson * 06-11-15 * */ import java.util.*; public class Komponent { public String name; private LinkedList mytext; private LinkedList choices;//String private LinkedList targets;//String //Konstruktor public Komponent(String aName){ name = aName; choices = new LinkedList(); targets = new LinkedList(); } //setter för text public void setText(LinkedList text){ mytext = text; } /* * Lägger till choice och target * * @param String cho, A string describing the choice * @param String tar, A String matching the name of the target * */ public void addChoice(String cho, String tar){ choices.addLast(cho); targets.addLast(tar); } /* * Returns the choice at position aPos. * * @param Int aPos, the position of the choice get return. * */ public LinkedList getChoices(){ return choices; } /* * Returns the target at position aPos. * * @param Int aPos, the position of the target get return. * */ public LinkedList getTargets(){ return targets; } //getter public LinkedList getText(){ return mytext; } // For debugging only, prints a System.out - debug line. public void debugPrint(){ System.out.println("--- "+name+" ---"); for( int i=0;i