01: //$Id: RSSSequence.java,v 1.5 2004/03/25 10:09:10 taganaka Exp $
02: package org.gnu.stealthp.rsslib;
03:
04: import java.util.LinkedList;
05:
06: /**
07: * RSSSequences's definitions class.
08: *
09: * <blockquote>
10: * <em>This module, both source code and documentation, is in the
11: * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
12: * </blockquote>
13: *
14: * @since RSSLIB4J 0.1
15: * @author Francesco aka 'Stealthp' stealthp[@]stealthp.org
16: * @version 0.2
17: */
18:
19: public class RSSSequence {
20:
21: private LinkedList list;
22:
23: public RSSSequence() {
24: list = new LinkedList();
25: }
26:
27: /**
28: * Add an element to a sequence
29: * @param el the RSSSequenceElement elment
30: */
31: public void addElement(RSSSequenceElement el) {
32: list.add(el);
33: }
34:
35: /**
36: * Return the element of a squence into a LinkedList
37: * @return The list
38: */
39: public LinkedList getElementList() {
40: return list;
41: }
42:
43: /**
44: * Return the size of a sequence
45: * @return the size
46: */
47: public int getListSize() {
48: return list.size();
49: }
50:
51: /**
52: * Useful for debug
53: * @return information
54: */
55: public String toString() {
56: String info = "SEQUENCE HAS " + getListSize() + " ELEMENTS.\n";
57: for (int i = 0; i < list.size(); i++) {
58: RSSSequenceElement e = (RSSSequenceElement) list.get(i);
59: info += e.toString() + "\n";
60: }
61: return info;
62: }
63:
64: }
|