Purple Code

com.purpletech.message.server
Class ClientSet

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractSet
              |
              +--com.purpletech.message.server.ClientSet
All Implemented Interfaces:
java.util.Collection, java.util.Set

public class ClientSet
extends java.util.AbstractSet

A List specialized to store Client objects. Uses a HashMap based on ID to optimize contains() and remove().


Field Summary
protected  java.util.Map map
           
 
Constructor Summary
ClientSet()
           
ClientSet(java.util.Collection c)
           
 
Method Summary
 boolean add(java.lang.Object o)
           
 java.lang.Object clone()
           
 Client get(int id)
           
protected  java.lang.Integer getKey(java.lang.Object o)
           
 java.util.Iterator iterator()
           
 boolean remove(java.lang.Object o)
           
 int size()
           
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
addAll, clear, contains, containsAll, isEmpty, 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
addAll, clear, contains, containsAll, isEmpty, retainAll, toArray, toArray
 

Field Detail

map

protected java.util.Map map
Constructor Detail

ClientSet

public ClientSet()

ClientSet

public ClientSet(java.util.Collection c)
Method Detail

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface java.util.Set
Specified by:
iterator in class java.util.AbstractCollection

size

public int size()
Specified by:
size in interface java.util.Set
Specified by:
size in class java.util.AbstractCollection

getKey

protected java.lang.Integer getKey(java.lang.Object o)

add

public boolean add(java.lang.Object o)
Specified by:
add in interface java.util.Set
Overrides:
add in class java.util.AbstractCollection

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.Set
Overrides:
remove in class java.util.AbstractCollection

get

public Client get(int id)

Documentation generated March 5 2003