org.eodisp.hla.common.handles
Class FederateHandleSetImpl

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
          extended by java.util.HashSet
              extended by org.eodisp.hla.common.handles.FederateHandleSetImpl
All Implemented Interfaces:
FederateHandleSet, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.Set

public class FederateHandleSetImpl
extends java.util.HashSet
implements FederateHandleSet

All Set operations are required, none are optional. Methods add and remove should throw IllegalArgumentException if the argument is not a FederateHandleHandle. Methods addAll, removeAll and retainAll should throw IllegalArgumentException if the argument is not a FederateHandleSet.

Author:
Andrzej Kapolka
See Also:
Serialized Form

Constructor Summary
protected FederateHandleSetImpl()
          Constructor.
 
Method Summary
 boolean add(java.lang.Object o)
          Adds the specified object to this set.
 boolean addAll(java.util.Collection c)
          Adds all of the objects in the specified collection to this set.
 boolean remove(java.lang.Object o)
          Removes the specified object from this set.
 boolean removeAll(java.util.Collection c)
          Removes all of the objects in the specified collection from this set.
 boolean retainAll(java.util.Collection c)
          Removes all of the objects in this set except for those present in the specified collection.
 
Methods inherited from class java.util.HashSet
clear, clone, contains, isEmpty, iterator, size
 
Methods inherited from class java.util.AbstractSet
equals, hashCode
 
Methods inherited from class java.util.AbstractCollection
containsAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
clear, contains, containsAll, equals, hashCode, isEmpty, iterator, size, toArray, toArray
 

Constructor Detail

FederateHandleSetImpl

protected FederateHandleSetImpl()
Constructor.

Method Detail

add

public boolean add(java.lang.Object o)
Adds the specified object to this set.

Specified by:
add in interface java.util.Collection
Specified by:
add in interface java.util.Set
Overrides:
add in class java.util.HashSet
Parameters:
o - the object to add
Returns:
true if the set changed as a result of this method call, false otherwise
Throws:
java.lang.IllegalArgumentException - if the object is not a FederateHandle

remove

public boolean remove(java.lang.Object o)
Removes the specified object from this set.

Specified by:
remove in interface java.util.Collection
Specified by:
remove in interface java.util.Set
Overrides:
remove in class java.util.HashSet
Parameters:
o - the object to remove
Returns:
true if the set changed as a result of this method call, false otherwise
Throws:
java.lang.IllegalArgumentException - if the object is not a FederateHandle

addAll

public boolean addAll(java.util.Collection c)
Adds all of the objects in the specified collection to this set.

Specified by:
addAll in interface java.util.Collection
Specified by:
addAll in interface java.util.Set
Overrides:
addAll in class java.util.AbstractCollection
Parameters:
c - the collection containing the objects to add
Returns:
true if the set changed as a result of this method call, false otherwise
Throws:
java.lang.IllegalArgumentException - if the collection is not a FederateHandleSet

removeAll

public boolean removeAll(java.util.Collection c)
Removes all of the objects in the specified collection from this set.

Specified by:
removeAll in interface java.util.Collection
Specified by:
removeAll in interface java.util.Set
Overrides:
removeAll in class java.util.AbstractSet
Parameters:
c - the collection containing the objects to remove
Returns:
true if the set changed as a result of this method call, false otherwise
Throws:
java.lang.IllegalArgumentException - if the collection is not a FederateHandleSet

retainAll

public boolean retainAll(java.util.Collection c)
Removes all of the objects in this set except for those present in the specified collection.

Specified by:
retainAll in interface java.util.Collection
Specified by:
retainAll in interface java.util.Set
Overrides:
retainAll in class java.util.AbstractCollection
Parameters:
c - the collection containing the objects to retain
Returns:
true if the set changed as a result of this method call, false otherwise
Throws:
java.lang.IllegalArgumentException - if the collection is not a FederateHandleSet