// Job: Jay's Own Browser, a web browser written in Java by Jay Skeer // Copyright (C) 1996 Jay Skeer, Jay Prime Positive // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // import java.util.Vector; public class HotTexts extends Vector { public HotTexts() { super(); } public HotTexts(int init, int grow) { super(init, grow); } public void addElement(HotText h) { Jdb.trace("add element (HotText "+h+") to self"); super.addElement((Object) h); } public void add(HotText h) { Jdb.trace("add element (HotText "+h+") to self"); super.addElement((Object) h); } public void addElement(String s) { Jdb.trace("add element (String "+s+") to self"); super.addElement((Object) new HotText(s)); } public void add(String s) { Jdb.trace("add element (String "+s+") to self"); super.addElement((Object) new HotText(s)); } public void addElement(String s, HotItem hi) { Jdb.trace("add element (String "+s+" HotItem "+hi+") to self"); super.addElement((Object) new HotText(s, hi)); } public void add(String s, HotItem hi) { Jdb.trace("add element (String "+s+" HotItem "+hi+") to self"); super.addElement((Object) new HotText(s, hi)); } public HotText getElementAt(int index) { return (HotText)super.elementAt(index); } public HotText getLastElement() { HotText rv= null; int z= size(); if (0 < z) { rv= (HotText)super.elementAt(size()-1); } return rv; } /** return all the text's appended into one string */ public String getTexts() { StringBuffer sb= new StringBuffer(); int siz= size(); for (int pos= 0; pos < siz; pos++) { sb.append(getElementAt(pos).getText()); } return sb.toString(); } }