KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > chaperon > model > symbol > SymbolCollection


1 /*
2  * Copyright (C) Chaperon. All rights reserved.
3  * -------------------------------------------------------------------------
4  * This software is published under the terms of the Apache Software License
5  * version 1.1, a copy of which has been included with this distribution in
6  * the LICENSE file.
7  */

8
9 package net.sourceforge.chaperon.model.symbol;
10
11 /**
12  * This class represents a abstract collection of symbols.
13  *
14  * @author <a HREF="mailto:stephan@apache.org">Stephan Michels</a>
15  * @version CVS $Id: SymbolCollection.java,v 1.4 2003/12/09 19:55:53 benedikta Exp $
16  */

17 public interface SymbolCollection
18 {
19   /*
20    * Add a symbol to this colection
21    *
22    * @param symbol Symbol, which should added
23    *
24    * @return Index of the symbol in this collection
25    */

26   public boolean addSymbol(Symbol symbol);
27
28   /*
29    * Add the symbols from an other collection to this collection.
30    *
31    * @param collection Collection of symbols.
32    */

33   public boolean addSymbol(SymbolCollection collection);
34
35   /**
36    * Removes a symbol by an index from this collection
37    *
38    * @param index Index of the symbol.
39    */

40   public void removeSymbol(int index);
41
42   /**
43    * Removes a symbol from this collection.
44    *
45    * @param symbol Symbol, which should be removed.
46    */

47   public void removeSymbol(Symbol symbol);
48
49   /**
50    * Replace a symbol by an index.
51    *
52    * @param index The index, at which the symbol be inserted.
53    * @param symbol Symbol.
54    */

55   public void setSymbol(int index, Symbol symbol);
56
57   /**
58    * Return a symbol giving by an index.
59    *
60    * @param index Index of the symbol.
61    *
62    * @return Symbol.
63    */

64   public Symbol getSymbol(int index);
65
66   /**
67    * Returns a symbol from this collection given by the name of the symbol.
68    *
69    * @param name Name of the symbol.
70    *
71    * @return Symbol.
72    */

73   public Symbol getSymbol(String JavaDoc name);
74
75   /**
76    * Returns the count of symbols in the collection.
77    *
78    * @return Count of symbols.
79    */

80   public int getSymbolCount();
81
82   /**
83    * If this collection is empty.
84    *
85    * @return True, if the collection is empty.
86    */

87   public boolean isEmpty();
88
89   /**
90    * Return the index of a symbol.
91    *
92    * @param symbol Symbol.
93    *
94    * @return Index of this symbol.
95    */

96   public int indexOf(Symbol symbol);
97
98   /**
99    * Return the index of a symbol, given by the name of the Symbol.
100    *
101    * @param name Name of symbol.
102    *
103    * @return Index of this symbol.
104    */

105   public int indexOf(String JavaDoc name);
106
107   /**
108    * If the collection contains the symbol.
109    *
110    * @param symbol Symbol.
111    *
112    * @return True, if the collection contains the symbol.
113    */

114   public boolean contains(Symbol symbol);
115
116   /**
117    * If the collection contains a symbol, given by the name of the symbol.
118    *
119    * @param name Name of the symbol.
120    *
121    * @return True, if the collection contains the symbol.
122    */

123   public boolean contains(String JavaDoc name);
124
125   /**
126    * Removes all symbols from this collection.
127    */

128   public void clear();
129
130   /**
131    * Compares to another collection of symbols.
132    *
133    * @param o Another object.
134    *
135    * @return True, if both collections contains the same symbols.
136    */

137   public boolean equals(Object JavaDoc o);
138
139   /**
140    * Return a string representation of the collection.
141    *
142    * @return String representation of the collection.
143    */

144   public String JavaDoc toString();
145 }
146
Popular Tags