Source code: javax/ide/model/Folder.java
1 package javax.ide.model;
2
3 import java.util.Collection;
4
5 /**
6 * The <CODE>Folder</CODE> interface extends {@link Element} by adding
7 * methods for managing child {@link Element}s contained by the
8 * <CODE>Folder</CODE>.
9 */
10 public interface Folder // extends Element
11 {
12 /**
13 * Other classes can call this method to determine whether the given
14 * {@link Element} can be added to the <CODE>Folder</CODE>.
15 *
16 * @param element the {@link Element} that is about to be added
17 * to this <CODE>Folder</CODE>.
18 *
19 * @return <CODE>true</CODE> if the specified {@link Element} can be
20 * added to this <CODE>Folder</CODE>; <CODE>false</CODE> if the
21 * {@link Element} cannot be added.
22 */
23 public boolean canAdd( Element element );
24
25 /**
26 * Appends a child {@link Element} to the end of the
27 * <CODE>Folder</CODE>.
28 */
29 public boolean add( Element child );
30
31 /**
32 * Appends children {@link Element} to the end of the
33 * <CODE>Folder</CODE>.
34 */
35 public boolean add( Collection children );
36
37 /**
38 * Other classes can call this method to determine whether the
39 * specified {@link Element} can be removed from this
40 * <CODE>Folder</CODE>.
41 *
42 * @param element the {@link Element} that is about to be removed
43 * from this <CODE>Folder</CODE>.
44 *
45 * @return <CODE>true</CODE> if the specified {@link Element} can be
46 * removed from this <CODE>Folder</CODE>; <CODE>false</CODE> if the
47 * {@link Element} cannot be removed.
48 */
49 public boolean canRemove( Element element );
50
51 /**
52 * Removes the specified child {@link Element}. If the child object
53 * appears more than once, only the first instance is removed.
54 *
55 * @param child The child object to remove.
56 */
57 public boolean remove( Element child );
58
59 /**
60 * Removes the specified children {@link Element}. If any of the children
61 * appears more than once, only the first instance is removed.
62 *
63 * @param children The children to remove.
64 */
65 public boolean remove( Collection children );
66
67 /**
68 * Returns <CODE>true</CODE> if the folder contains the
69 * specified child {@link Element}; returns <CODE>false</CODE>
70 * otherwise.
71 */
72 public boolean containsChild( Element child );
73
74 /**
75 * Returns the current number of children in the folder.
76 */
77 public int size();
78
79 /**
80 * Removes all children from the folder.
81 */
82 public void removeAll();
83
84 }