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

java.lang.Object
  extended by net.sf.jbaobab.io.etc.ChannelCoreBank<P>
All Implemented Interfaces:
ChannelCore<P>

public final class ChannelCoreBank<P>
extends Object
implements ChannelCore<P>

A collection similar to Map, but ChannelCoreBank allows multimple values for same key. Value can be ChannelCore or ChannelCoreSet,and both provide net.sf.jbaobab.io.ChannelCore#schedulePacket(P), ChannelCore.scheduleShutdown() and ChannelCore.shutdown() operations.

Author:
Oakyoon Cha

Constructor Summary
ChannelCoreBank()
           
 
Method Summary
 int add(String key, ChannelCore<P> core)
           
 boolean containsKey(String key)
           
 int estimate(String key)
           
 ChannelCore<P> get(String key)
           
 boolean isEmpty()
           
 Set<String> keySet()
           
 Protocol<P> protocol()
           
 int receive(PacketHandler<P> handler)
           
 void remove(String key)
           
 int remove(String key, ChannelCore<P> core)
           
 void schedulePacket(P packet)
           
 void scheduleShutdown()
           
 int send()
           
 void shutdown()
           
 int size()
           
 String track()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChannelCoreBank

public ChannelCoreBank()
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>

get

public ChannelCore<P> get(String key)

estimate

public int estimate(String key)

add

public int add(String key,
               ChannelCore<P> core)

remove

public int remove(String key,
                  ChannelCore<P> core)

remove

public void remove(String key)

keySet

public Set<String> keySet()

containsKey

public boolean containsKey(String key)

isEmpty

public boolean isEmpty()

size

public int size()