| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Portions Copyright 2006 Sun Microsystems, Inc. |
| | | * Portions Copyright 2006-2007 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.api; |
| | | |
| | | import static org.opends.server.loggers.Debug.debugConstructor; |
| | | import static org.opends.server.loggers.Debug.debugEnter; |
| | | |
| | | import java.util.AbstractSet; |
| | | import java.util.Collection; |
| | | import java.util.HashSet; |
| | |
| | | */ |
| | | public final class SubtreeSpecificationSet extends |
| | | AbstractSet<SubtreeSpecification> { |
| | | // Fully qualified class name for debugging purposes. |
| | | private static final String CLASS_NAME = |
| | | SubtreeSpecificationSet.class.getName(); |
| | | |
| | | // Underlying implementation is simply a set. |
| | | private HashSet<SubtreeSpecification> pimpl; |
| | |
| | | * Constructs a new empty subtree specification set. |
| | | */ |
| | | public SubtreeSpecificationSet() { |
| | | assert debugConstructor(CLASS_NAME); |
| | | |
| | | this.pimpl = new HashSet<SubtreeSpecification>(); |
| | | } |
| | |
| | | */ |
| | | public SubtreeSpecificationSet( |
| | | Collection<? extends SubtreeSpecification> c) { |
| | | assert debugConstructor(CLASS_NAME); |
| | | |
| | | this.pimpl = new HashSet<SubtreeSpecification>(c); |
| | | } |
| | |
| | | * specified entry. |
| | | */ |
| | | public boolean isWithinScope(Entry entry) { |
| | | assert debugEnter(CLASS_NAME, "contains"); |
| | | |
| | | for (SubtreeSpecification subtreeSpecification : pimpl) { |
| | | if (subtreeSpecification.isWithinScope(entry)) { |
| | |
| | | */ |
| | | @Override |
| | | public boolean add(SubtreeSpecification e) { |
| | | assert debugEnter(CLASS_NAME, "add"); |
| | | |
| | | return pimpl.add(e); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public Iterator<SubtreeSpecification> iterator() { |
| | | assert debugEnter(CLASS_NAME, "iterator"); |
| | | |
| | | return pimpl.iterator(); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public boolean contains(Object o) { |
| | | assert debugEnter(CLASS_NAME, "contains"); |
| | | |
| | | return pimpl.contains(o); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public int size() { |
| | | assert debugEnter(CLASS_NAME, "size"); |
| | | |
| | | return pimpl.size(); |
| | | } |