1 | public boolean hasSelectors() {↵ | | 1 | public boolean hasSelectors() {↵
|
2 | return !(selectorsList.isEmpty());↵ | | 2 | return !(selectorsList.isEmpty());↵
|
3 | }↵ | | 3 | }↵
|
|
4 | /**↵ | | 4 | /**↵
|
5 | * Gives the count of the number of selectors in this container↵ | | 5 | * Gives the count of the number of selectors in this container↵
|
6 | * @return the number of selectors↵ | | 6 | * @return the number of selectors↵
|
7 | */↵ | | 7 | */↵
|
8 | public int selectorCount() {↵ | | 8 | public int selectorCount() {↵
|
9 | return selectorsList.size();↵ | | 9 | return selectorsList.size();↵
|
10 | }↵ | | 10 | }↵
|
|
11 | /**↵ | | 11 | /**↵
|
12 | * Returns the set of selectors as an array.↵ | | 12 | * Returns the set of selectors as an array.↵
|
13 | * @param p the current project↵ | | 13 | * @param p the current project↵
|
14 | * @return an array of selectors↵ | | 14 | * @return an array of selectors↵
|
15 | */↵ | | 15 | */↵
|
16 | public FileSelector[] getSelectors(Project p) {↵ | | 16 | public FileSelector[] getSelectors(Project p) {↵
|
17 | FileSelector[] result = new FileSelector[selectorsList.size()];↵ | | 17 | FileSelector[] result = new FileSelector[selectorsList.size()];↵
|
18 | selectorsList.copyInto(result);↵ | | 18 | selectorsList.copyInto(result);↵
|
19 | return result;↵ | | 19 | return result;↵
|
20 | }↵ | | 20 | }↵
|
|
21 | /**↵ | | 21 | /**↵
|
22 | * Returns an enumerator for accessing the set of selectors.↵ | | 22 | * Returns an enumerator for accessing the set of selectors.↵
|
23 | * @return an enumerator for the selectors↵ | | 23 | * @return an enumerator for the selectors↵
|
24 | */↵ | | 24 | */↵
|
25 | public Enumeration selectorElements() {↵ | | 25 | public Enumeration selectorElements() {↵
|
26 | return selectorsList.elements();↵ | | 26 | return selectorsList.elements();↵
|
27 | }↵ | | 27 | }↵
|
|
28 | /**↵ | | 28 | /**↵
|
29 | * Convert the Selectors within this container to a string. This will↵ | | 29 | * Convert the Selectors within this container to a string. This will↵
|
30 | * just be a helper class for the subclasses that put their own name↵ | | 30 | * just be a helper class for the subclasses that put their own name↵
|
31 | * around the contents listed here.↵ | | 31 | * around the contents listed here.↵
|
32 | *↵ | | 32 | *↵
|
33 | * @return comma separated list of Selectors contained in this one↵ | | 33 | * @return comma separated list of Selectors contained in this one↵
|
34 | */↵ | | 34 | */↵
|
35 | public String toString() {↵ | | 35 | public String toString() {↵
|
36 | StringBuffer buf = new StringBuffer();↵ | | 36 | StringBuffer buf = new StringBuffer();↵
|
37 | Enumeration e = selectorElements();↵ | | 37 | Enumeration e = selectorElements();↵
|
38 | if (e.hasMoreElements()) {↵ | | 38 | if (e.hasMoreElements()) {↵
|
39 | while (e.hasMoreElements()) {↵ | | 39 | while (e.hasMoreElements()) {↵
|
40 | buf.append(e.nextElement().toString());↵ | | 40 | buf.append(e.nextElement().toString());↵
|
41 | if (e.hasMoreElements()) {↵ | | 41 | if (e.hasMoreElements()) {↵
|
42 | buf.append(", ");↵ | | 42 | buf.append(", ");↵
|
43 | }↵ | | 43 | }↵
|
44 | }↵ | | 44 | }↵
|
45 | }↵ | | 45 | }↵
|
|
46 | return buf.toString();↵ | | 46 | return buf.toString();↵
|
47 | }↵ | | 47 | }↵
|
|
48 | /**↵ | | 48 | /**↵
|
49 | * Add a new selector into this container.↵ | | 49 | * Add a new selector into this container.↵
|
50 | *↵ | | 50 | *↵
|
51 | * @param selector the new selector to add↵ | | 51 | * @param selector the new selector to add↵
|
52 | */↵ | | 52 | */↵
|
53 | public void appendSelector(FileSelector selector) {↵ | | 53 | public void appendSelector(FileSelector selector) {↵
|
54 | selectorsList.addElement(selector); | | 54 | selectorsList.addElement(selector);
|