org.opends.server.api
Class SubtreeSpecificationSet

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<SubtreeSpecification>
          extended by org.opends.server.api.SubtreeSpecificationSet
All Implemented Interfaces:
java.lang.Iterable<SubtreeSpecification>, java.util.Collection<SubtreeSpecification>, java.util.Set<SubtreeSpecification>

@PublicAPI(stability=VOLATILE,
           mayInstantiate=true,
           mayExtend=false,
           mayInvoke=true)
public final class SubtreeSpecificationSet
extends java.util.AbstractSet<SubtreeSpecification>

This class implements the Set interface for SubtreeSpecifications.

It is backed by a HashSet but provides additional functionality, isWithinScope(Entry), for determining whether or not an entry is within the scope of one or more contained SubtreeSpecifications.


Constructor Summary
SubtreeSpecificationSet()
          Constructs a new empty subtree specification set.
SubtreeSpecificationSet(java.util.Collection<? extends SubtreeSpecification> c)
          Constructs a new subtree specification set containing the elements in the specified collection.
 
Method Summary
 boolean add(SubtreeSpecification e)
          Adds the provided subtree specification object to this set.
 boolean contains(java.lang.Object o)
          Indicates whether this set contains the provided object.
 boolean isWithinScope(Entry entry)
          Returns true if the specified entry is within the scope of a subtree specifications contained in the set.
 java.util.Iterator<SubtreeSpecification> iterator()
          Retrieves an iterator that may be used to step through the values in this set.
 int size()
          Retrieves the number of elements contained in this set.
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
addAll, clear, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
addAll, clear, containsAll, isEmpty, remove, retainAll, toArray, toArray
 

Constructor Detail

SubtreeSpecificationSet

public SubtreeSpecificationSet()
Constructs a new empty subtree specification set.


SubtreeSpecificationSet

public SubtreeSpecificationSet(java.util.Collection<? extends SubtreeSpecification> c)
Constructs a new subtree specification set containing the elements in the specified collection.

Parameters:
c - The subtree specification collection whose elements are to be placed into this set.
Method Detail

isWithinScope

public boolean isWithinScope(Entry entry)
Returns true if the specified entry is within the scope of a subtree specifications contained in the set.

Parameters:
entry - The entry to be checked for containment.
Returns:
Returns true if the set contains the specified entry.

add

public boolean add(SubtreeSpecification e)
Adds the provided subtree specification object to this set.

Specified by:
add in interface java.util.Collection<SubtreeSpecification>
Specified by:
add in interface java.util.Set<SubtreeSpecification>
Overrides:
add in class java.util.AbstractCollection<SubtreeSpecification>
Parameters:
e - The subtree specification object to be added.
Returns:
true if the element was added to the set, or false if the element was already contained in the set.

iterator

public java.util.Iterator<SubtreeSpecification> iterator()
Retrieves an iterator that may be used to step through the values in this set.

Specified by:
iterator in interface java.lang.Iterable<SubtreeSpecification>
Specified by:
iterator in interface java.util.Collection<SubtreeSpecification>
Specified by:
iterator in interface java.util.Set<SubtreeSpecification>
Specified by:
iterator in class java.util.AbstractCollection<SubtreeSpecification>
Returns:
An iterator that may be used to step through the values in this set.

contains

public boolean contains(java.lang.Object o)
Indicates whether this set contains the provided object.

Specified by:
contains in interface java.util.Collection<SubtreeSpecification>
Specified by:
contains in interface java.util.Set<SubtreeSpecification>
Overrides:
contains in class java.util.AbstractCollection<SubtreeSpecification>
Parameters:
o - The object for which to make the determination.
Returns:
true if this set contains the provided object, or false if not.

size

public int size()
Retrieves the number of elements contained in this set.

Specified by:
size in interface java.util.Collection<SubtreeSpecification>
Specified by:
size in interface java.util.Set<SubtreeSpecification>
Specified by:
size in class java.util.AbstractCollection<SubtreeSpecification>
Returns:
The number of elements contained in this set.