fr.inria.opengve.bridge.interfaces
Interface HierarchicalSet<E>

All Superinterfaces:
java.util.Collection<E>, java.lang.Iterable<E>, java.util.Set<E>

public interface HierarchicalSet<E>
extends java.util.Set<E>

This interface defines the functionalities of the sets returned by methods of the interface Graph.

Author:
Ricardo Correa (correa@lia.ufc.br)
See Also:
Set, Graph

Method Summary
 void disconnect()
          Disconnects this set of its superset.
 HierarchicalSet<E> getSuperSet()
          If this set has been created as a subset of another set s with newSubSet() or newSubSet(Iterator), then returns s.
 boolean isSubSetOf(HierarchicalSet<?> set)
          Says if the object is a subset of a specified set.
 HierarchicalSet<E> newSubSet()
          Returns a new empty set which is a subset of this set.
 HierarchicalSet<E> newSubSet(java.util.Iterator<? extends E> it)
          Returns a new set which is a subset of this set.
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Method Detail

newSubSet

HierarchicalSet<E> newSubSet()
Returns a new empty set which is a subset of this set. The set returned only accepts insertions of elements of this set. In addition, the new set is connected to this one in the sense that if an element belonging to the new set is removed from this set, then it is automatically removed from the new set. This behavior guarantees that the property of the new set being a subset of this set is an invariant.

Returns:
a new empty set being a subset of this one.

newSubSet

HierarchicalSet<E> newSubSet(java.util.Iterator<? extends E> it)
                             throws java.lang.IllegalArgumentException
Returns a new set which is a subset of this set. The elements of the new set are determined by a spefified iterator. The set returned only accepts insertions of elements of this set. In addition, the new set is connected to this one in the sense that if an element belonging to the new set is removed from this set, then it is automatically removed from the new set. This behavior guarantees that the property of the new set being a subset of this set is an invariant.

Parameters:
it - the iterator that enumerates the elements of this set defining the new set.
Returns:
a new set containing the element of this one enumerated with the specified iterator.
Throws:
java.lang.IllegalArgumentException - If one elements return by the iterator is not in this set.

getSuperSet

HierarchicalSet<E> getSuperSet()
If this set has been created as a subset of another set s with newSubSet() or newSubSet(Iterator), then returns s. Otherwise, returns null.

Returns:
the super set of this set.

isSubSetOf

boolean isSubSetOf(HierarchicalSet<?> set)
Says if the object is a subset of a specified set.

Parameters:
set - the potential superset of this set.
Returns:
true if the object is a subset of a specified set and false otherwise.

disconnect

void disconnect()
Disconnects this set of its superset. The implementation of this method should remove all the references to this set from its superset.



Copyright © 2009 INRIA (Projet Mascotte). All Rights Reserved.