/** * Constructor. * * @param newBackingList the list that backs this view * @param newIndex the element schema type or name of the sublist this view operates on */ public ListView(IndexedXMLObjectChildrenList<ElementType> newBackingList, QName newIndex) { backingList = newBackingList; index = newIndex; indexList = backingList.get(index); }
/** * Constructor. * * @param newBackingList the list that backs this view * @param newIndex the element schema type or name of the sublist this view operates on */ public ListView(IndexedXMLObjectChildrenList<ElementType> newBackingList, QName newIndex) { backingList = newBackingList; index = newIndex; indexList = backingList.get(index); }
/** * Indexes the given SAMLobject by the given index. * * @param index the index for the element * @param element the element to be indexed */ protected void indexElement(QName index, ElementType element) { List<ElementType> objects = get(index); objects.add(element); }
/** * Removes an object from the given index id. * * @param index the id of the index * @param element the element to be removed from that index */ protected void removeElementFromIndex(QName index, ElementType element) { List<ElementType> objects = get(index); objects.remove(element); }
/** * Indexes the given SAMLobject by the given index. * * @param index the index for the element * @param element the element to be indexed */ protected void indexElement(QName index, ElementType element) { List<ElementType> objects = get(index); objects.add(element); }
/** * Removes an object from the given index id. * * @param index the id of the index * @param element the element to be removed from that index */ protected void removeElementFromIndex(QName index, ElementType element) { List<ElementType> objects = get(index); objects.remove(element); }
/** {@inheritDoc} */ public XMLObject getUnknownXMLObject() { // Have to do this b/c don't want to break existing code for both the // setUnknownXMLObject case as well as the unmarshalling case, which will be in the list. if (unknownChild != null) { return unknownChild; } else if (!unknownChildren.isEmpty()) { return unknownChildren.get(0); } else { return null; } }
/** {@inheritDoc} */ public boolean removeAll(Collection<?> c) { boolean result = backingList.removeAll(c); indexList = backingList.get(index); return result; }
/** {@inheritDoc} */ public boolean retainAll(Collection<?> c) { boolean result = backingList.retainAll(c); indexList = backingList.get(index); return result; }
/** {@inheritDoc} */ public boolean remove(Object o) { boolean result = backingList.remove(o); indexList = backingList.get(index); return result; }
/** {@inheritDoc} */ public boolean add(ElementType o) { boolean result = backingList.add(o); indexList = backingList.get(index); return result; }
/** {@inheritDoc} */ public boolean retainAll(Collection<?> c) { boolean result = backingList.retainAll(c); indexList = backingList.get(index); return result; }
/** {@inheritDoc} */ public boolean addAll(Collection<? extends ElementType> c) { boolean result = backingList.addAll(c); indexList = backingList.get(index); return result; }
/** {@inheritDoc} */ public boolean remove(Object o) { boolean result = backingList.remove(o); indexList = backingList.get(index); return result; }
/** {@inheritDoc} */ public boolean add(ElementType o) { boolean result = backingList.add(o); indexList = backingList.get(index); return result; }
/** {@inheritDoc} */ public boolean addAll(Collection<? extends ElementType> c) { boolean result = backingList.addAll(c); indexList = backingList.get(index); return result; }
/** {@inheritDoc} */ public boolean removeAll(Collection<?> c) { boolean result = backingList.removeAll(c); indexList = backingList.get(index); return result; }
/** {@inheritDoc} */ public void clear() { // Create a copy of the current list to avoid a potential concurrent modification error. LazyList<ElementType> copy = new LazyList<ElementType>(); copy.addAll(indexList); backingList.removeAll(copy); indexList = backingList.get(index); }
/** {@inheritDoc} */ public void clear() { // Create a copy of the current list to avoid a potential concurrent modification error. LazyList<ElementType> copy = new LazyList<ElementType>(); copy.addAll(indexList); backingList.removeAll(copy); indexList = backingList.get(index); }