net.sf.jbaobab.io.etc
Class ChannelCoreSet<P>

java.lang.Object
  extended by net.sf.jbaobab.io.etc.ChannelCoreSet<P>
All Implemented Interfaces:
Iterable<ChannelCore<P>>, Collection<ChannelCore<P>>, Set<ChannelCore<P>>, ChannelCore<P>

public final class ChannelCoreSet<P>
extends Object
implements ChannelCore<P>, Set<ChannelCore<P>>

A Set, providing net.sf.jbaobab.io.ChannelCore#schedulePacket(P), ChannelCore.scheduleShutdown() and ChannelCore.shutdown() operations for containing ChannelCore instances.

Author:
Oakyoon Cha

Constructor Summary
ChannelCoreSet()
           
 
Method Summary
 boolean add(ChannelCore<P> element)
           
 boolean addAll(Collection<? extends ChannelCore<P>> collection)
           
 void clear()
           
 boolean contains(Object object)
           
 boolean containsAll(Collection<?> collection)
           
 boolean isEmpty()
           
 Iterator<ChannelCore<P>> iterator()
           
 Protocol<P> protocol()
           
 int receive(PacketHandler<P> handler)
           
 boolean remove(Object object)
           
 boolean removeAll(Collection<?> collection)
           
 boolean retainAll(Collection<?> collection)
           
 void schedulePacket(P packet)
           
 void scheduleShutdown()
           
 int send()
           
 void shutdown()
           
 int size()
           
 Object[] toArray()
           
<T> T[]
toArray(T[] array)
           
 String track()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Set
equals, hashCode
 

Constructor Detail

ChannelCoreSet

public ChannelCoreSet()
Method Detail

protocol

public Protocol<P> protocol()
Specified by:
protocol in interface ChannelCore<P>

receive

public int receive(PacketHandler<P> handler)
            throws IOException
Specified by:
receive in interface ChannelCore<P>
Throws:
IOException

send

public int send()
         throws IOException
Specified by:
send in interface ChannelCore<P>
Throws:
IOException

shutdown

public void shutdown()
Specified by:
shutdown in interface ChannelCore<P>

schedulePacket

public void schedulePacket(P packet)
Specified by:
schedulePacket in interface ChannelCore<P>

scheduleShutdown

public void scheduleShutdown()
Specified by:
scheduleShutdown in interface ChannelCore<P>

track

public String track()
Specified by:
track in interface ChannelCore<P>

size

public int size()
Specified by:
size in interface Collection<ChannelCore<P>>
Specified by:
size in interface Set<ChannelCore<P>>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<ChannelCore<P>>
Specified by:
isEmpty in interface Set<ChannelCore<P>>

contains

public boolean contains(Object object)
Specified by:
contains in interface Collection<ChannelCore<P>>
Specified by:
contains in interface Set<ChannelCore<P>>

iterator

public Iterator<ChannelCore<P>> iterator()
Specified by:
iterator in interface Iterable<ChannelCore<P>>
Specified by:
iterator in interface Collection<ChannelCore<P>>
Specified by:
iterator in interface Set<ChannelCore<P>>

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<ChannelCore<P>>
Specified by:
toArray in interface Set<ChannelCore<P>>

toArray

public <T> T[] toArray(T[] array)
Specified by:
toArray in interface Collection<ChannelCore<P>>
Specified by:
toArray in interface Set<ChannelCore<P>>

add

public boolean add(ChannelCore<P> element)
Specified by:
add in interface Collection<ChannelCore<P>>
Specified by:
add in interface Set<ChannelCore<P>>

remove

public boolean remove(Object object)
Specified by:
remove in interface Collection<ChannelCore<P>>
Specified by:
remove in interface Set<ChannelCore<P>>

containsAll

public boolean containsAll(Collection<?> collection)
Specified by:
containsAll in interface Collection<ChannelCore<P>>
Specified by:
containsAll in interface Set<ChannelCore<P>>

addAll

public boolean addAll(Collection<? extends ChannelCore<P>> collection)
Specified by:
addAll in interface Collection<ChannelCore<P>>
Specified by:
addAll in interface Set<ChannelCore<P>>

retainAll

public boolean retainAll(Collection<?> collection)
Specified by:
retainAll in interface Collection<ChannelCore<P>>
Specified by:
retainAll in interface Set<ChannelCore<P>>

removeAll

public boolean removeAll(Collection<?> collection)
Specified by:
removeAll in interface Collection<ChannelCore<P>>
Specified by:
removeAll in interface Set<ChannelCore<P>>

clear

public void clear()
Specified by:
clear in interface Collection<ChannelCore<P>>
Specified by:
clear in interface Set<ChannelCore<P>>