/* * WordList.java * * Created on September 11, 2006, 11:32 AM */ package Current.popups.ListPlotter; import java.util.*; import java.awt.Color; /** * * @author pat */ public class WordList { protected LinkedList words; /** Creates a new instance of WordList */ public WordList() { words=new LinkedList(); } /** add a word to the WordList. The color of this word will be determined from the manager. */ public void add(String word) { add(new Word(word)); } /** add a word to the WordList. * @param word the word * @param color the color the tile will be plotted */ public void add(String word, Color color) { add(new Word(word, color)); } /** add the word to the WordList */ protected void add(Word w) { words.addLast(w); } protected Word get() { if (size()>0) return (Word)(words.getFirst()); return null; } protected Word remove() { return (Word)(words.removeFirst()); } public int size() { return words.size(); } }