jxl.peermi
Class PeerHashSet<E extends PeerRemote>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
          extended by java.util.HashSet<E>
              extended by jxl.peermi.PeerHashSet<E>
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<E>, java.util.Collection<E>, java.util.Set<E>
Direct Known Subclasses:
PeerManager

public class PeerHashSet<E extends PeerRemote>
extends java.util.HashSet<E>

A HashSet conntaining only PeerRemote objects. The purpose of this class is to insure that any remote invocation made on the contained objects will be made on alive (that is, running) remote hosts. To do this, PeerHashSet calls PeerRemote.checkAlive() on ever object added to the collection, and on every object before it is returned from the iterator.

Author:
Alex Lynch
See Also:
Serialized Form

Constructor Summary
PeerHashSet()
          Creates a new instance of P2HashSet
 
Method Summary
 boolean add(E e)
           
 boolean addAll(java.util.Collection<? extends E> c)
           
 java.util.Iterator<E> iterator()
           
 
Methods inherited from class java.util.HashSet
clear, clone, contains, isEmpty, remove, size
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
containsAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray
 

Constructor Detail

PeerHashSet

public PeerHashSet()
Creates a new instance of P2HashSet

Method Detail

add

public boolean add(E e)
Specified by:
add in interface java.util.Collection<E extends PeerRemote>
Specified by:
add in interface java.util.Set<E extends PeerRemote>
Overrides:
add in class java.util.HashSet<E extends PeerRemote>

addAll

public boolean addAll(java.util.Collection<? extends E> c)
Specified by:
addAll in interface java.util.Collection<E extends PeerRemote>
Specified by:
addAll in interface java.util.Set<E extends PeerRemote>
Overrides:
addAll in class java.util.AbstractCollection<E extends PeerRemote>

iterator

public java.util.Iterator<E> iterator()
Specified by:
iterator in interface java.lang.Iterable<E extends PeerRemote>
Specified by:
iterator in interface java.util.Collection<E extends PeerRemote>
Specified by:
iterator in interface java.util.Set<E extends PeerRemote>
Overrides:
iterator in class java.util.HashSet<E extends PeerRemote>