/**
* Indicates whether there are any selectors here.
* @return true if there are selectors
*/
public boolean hasSelectors() {
return !(selectorsList.isEmpty());
}
/**
* Gives the count of the number of selectors in this container
* @return the number of selectors
*/
public int selectorCount() {
return selectorsList.size();
}
/**
* Returns the set of selectors as an array.
* @param p the current project
* @return an array of selectors
*/
public FileSelector[] getSelectors(Project p) {
FileSelector[] result = new FileSelector[selectorsList.size()];
selectorsList.copyInto(result);
return result;
}
/**
* Returns an enumerator for accessing the set of selectors.
* @return an enumerator for the selectors
*/
public Enumeration selectorElements() {
return selectorsList.elements();
}
/**
* Convert the Selectors within this container to a string. This will
* just be a helper class for the subclasses that put their own name
* around the contents listed here.
*
* @return comma separated list of Selectors contained in this one
*/
public String toString() {
StringBuffer buf = new StringBuffer();
Enumeration e = selectorElements();
if (e.hasMoreElements()) {
while (e.hasMoreElements()) {
buf.append(e.nextElement().toString());
if (e.hasMoreElements()) {
buf.append(", ");
}
}
}
return buf.toString();
}
/**
* Add a new selector into this container.
*
* @param selector the new selector to add
*/
public void appendSelector(FileSelector selector) {
selectorsList.addElement(selector);
}
|