Method from javax.faces.component.UIComponentBase$ChildrenList Detail: |
public boolean add(UIComponent element) {
if (element == null) {
throw new NullPointerException();
} else {
eraseParent(element);
boolean result = super.add(element);
element.setParent(component);
return result;
}
}
|
public void add(int index,
UIComponent element) {
if (element == null) {
throw new NullPointerException();
} else if ((index < 0) || (index > size())) {
throw new IndexOutOfBoundsException();
} else {
eraseParent(element);
super.add(index, element);
element.setParent(component);
}
}
|
public boolean addAll(Collection<UIComponent> collection) {
Iterator< UIComponent > elements =
(new ArrayList< UIComponent >(collection)).iterator();
boolean changed = false;
while (elements.hasNext()) {
UIComponent element = elements.next();
if (element == null) {
throw new NullPointerException();
} else {
add(element);
changed = true;
}
}
return (changed);
}
|
public boolean addAll(int index,
Collection<UIComponent> collection) {
Iterator< UIComponent > elements =
(new ArrayList< UIComponent >(collection)).iterator();
boolean changed = false;
while (elements.hasNext()) {
UIComponent element = elements.next();
if (element == null) {
throw new NullPointerException();
} else {
add(index++, element);
changed = true;
}
}
return (changed);
}
|
public void clear() {
int n = size();
if (n < 1) {
return;
}
for (int i = 0; i < n; i++) {
UIComponent child = get(i);
child.setParent(null);
}
super.clear();
}
|
public Iterator<UIComponent> iterator() {
return (new ChildrenListIterator(this));
}
|
public ListIterator<UIComponent> listIterator() {
return (new ChildrenListIterator(this));
}
|
public ListIterator<UIComponent> listIterator(int index) {
return (new ChildrenListIterator(this, index));
}
|
public UIComponent remove(int index) {
UIComponent child = get(index);
super.remove(index);
child.setParent(null);
return (child);
}
|
public boolean remove(Object elementObj) {
UIComponent element = (UIComponent) elementObj;
if (element == null) {
throw new NullPointerException();
}
if (super.remove(element)) {
element.setParent(null);
return (true);
} else {
return (false);
}
}
|
public boolean removeAll(Collection<?> collection) {
boolean result = false;
for (Object elements : collection) {
if (remove(elements)) {
result = true;
}
}
return (result);
}
|
public boolean retainAll(Collection<?> collection) {
boolean modified = false;
Iterator< ? > items = iterator();
while (items.hasNext()) {
if (!collection.contains(items.next())) {
items.remove();
modified = true;
}
}
return (modified);
}
|
public UIComponent set(int index,
UIComponent element) {
if (element == null) {
throw new NullPointerException();
} else if ((index < 0) || (index >= size())) {
throw new IndexOutOfBoundsException();
} else {
eraseParent(element);
UIComponent previous = get(index);
super.set(index, element);
previous.setParent(null);
element.setParent(component);
return (previous);
}
}
|