1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.composite;
17
18 /***
19 * A composite that can be queried for information about its components.
20 *
21 * @author Matt Sgarlata
22 * @since Dec 27, 2004
23 */
24 public interface ListableComposite extends Composite {
25
26 /***
27 * Returns the components that make up this composite that are of the given
28 * type.
29 *
30 * @param componentType
31 * the type of component for which we are searching
32 * @return the components that make up this composite that are of the given
33 * type
34 * @throws CompositeException
35 * if an error occurrs
36 * @see net.sf.composite.util.ContainerUtils#getElementsOfType(Object[], Class)
37 */
38 public Object[] getComponentsOfType(Class componentType)
39 throws CompositeException;
40
41 /***
42 * Indicates whether one or more components of the given type make up this
43 * composite.
44 *
45 * @param componentType
46 * the type of component for which we are searching
47 * @return <code>true</code> if one or more of the components of the given
48 * type make up this composite or <br>
49 * <code>false</code>, otherwise
50 * @throws CompositeException
51 * if an error occurrs
52 */
53 public boolean containsComponentOfType(Class componentType)
54 throws CompositeException;
55
56 }