src/net/fortuna/ical4j/model/ComponentList.java

changeset 3
73bdfa70b04e
parent 0
fb9019fb1bf7
equal deleted inserted replaced
0:ae7a77095953 1:61470b606cf8
122 122
123 /** 123 /**
124 * Add a component to the list. 124 * Add a component to the list.
125 * @param component the component to add 125 * @param component the component to add
126 * @return true 126 * @return true
127 * @see List#add(java.lang.Object) 127 * @see java.util.List#add(Object)
128 */ 128 */
129 public final boolean add(final Component component) { 129 public final boolean add(final Component component) {
130 return add((Object) component); 130 return add((Object) component);
131 } 131 }
132 132
133 /** 133 /**
134 * Overrides superclass to throw an <code>IllegalArgumentException</code> where argument is not a 134 * Overrides superclass to throw an <code>IllegalArgumentException</code> where argument is not a
135 * <code>net.fortuna.ical4j.model.Component</code>. 135 * <code>net.fortuna.ical4j.model.Component</code>.
136 * @param component a component to add 136 * @param component a component to add
137 * @return true if the object was added, otherwise false 137 * @return true if the object was added, otherwise false
138 * @see List#add(E) 138 * @see java.util.List#add(Object)
139 */ 139 */
140 public final boolean add(final Object component) { 140 public final boolean add(final Object component) {
141 if (!(component instanceof Component)) { 141 if (!(component instanceof Component)) {
142 throw new IllegalArgumentException("Argument not a " 142 throw new IllegalArgumentException("Argument not a "
143 + Component.class.getName()); 143 + Component.class.getName());
145 return super.add(component); 145 return super.add(component);
146 } 146 }
147 147
148 /** 148 /**
149 * @return boolean indicates if the list is empty 149 * @return boolean indicates if the list is empty
150 * @see List#isEmpty() 150 * @see java.util.List#isEmpty()
151 */ 151 */
152 // public final boolean isEmpty() { 152 // public final boolean isEmpty() {
153 // return components.isEmpty(); 153 // return components.isEmpty();
154 // } 154 // }
155 /** 155 /**
156 * @return an iterator 156 * @return an iterator
157 * @see List#iterator() 157 * @see java.util.List#iterator()
158 */ 158 */
159 // public final Iterator iterator() { 159 // public final Iterator iterator() {
160 // return components.iterator(); 160 // return components.iterator();
161 // } 161 // }
162 /** 162 /**
163 * Remove a component from the list. 163 * Remove a component from the list.
164 * @param component the component to remove 164 * @param component the component to remove
165 * @return true if the list contained the specified component 165 * @return true if the list contained the specified component
166 * @see List#remove(java.lang.Object) 166 * @see java.util.List#remove(java.lang.Object)
167 */ 167 */
168 public final boolean remove(final Component component) { 168 public final boolean remove(final Component component) {
169 return remove((Object) component); 169 return remove((Object) component);
170 } 170 }
171 171
172 /** 172 /**
173 * @return the number of components in the list 173 * @return the number of components in the list
174 * @see List#size() 174 * @see java.util.List#size()
175 */ 175 */
176 // public final int size() { 176 // public final int size() {
177 // return components.size(); 177 // return components.size();
178 // } 178 // }
179 /** 179 /**

mercurial