net.sf.jbaobab.helper
Class ProtocolHelper.PackedProtocolImpl<P>

java.lang.Object
  extended by net.sf.jbaobab.helper.ProtocolHelper.PackedProtocolImpl<P>
All Implemented Interfaces:
Protocol<P>, Seperator, Translator<P>
Enclosing class:
ProtocolHelper

public static final class ProtocolHelper.PackedProtocolImpl<P>
extends Object
implements Protocol<P>

A Protocol that delegates operations to Seperator and Translator. PackedProtocolImpl instance can be obtained by calling ProtocolHelper.pack(Seperator, Translator) method.

Author:
Oakyoon Cha

Method Summary
 boolean ready(ByteBuffer source)
           
 ByteBuffer seperate(ByteBuffer source)
           
 ByteBuffer terminate(ByteBuffer source)
           
 P translate(ByteBuffer buffer)
           
 ByteBuffer translate(P packet)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

ready

public boolean ready(ByteBuffer source)
Specified by:
ready in interface Seperator

seperate

public ByteBuffer seperate(ByteBuffer source)
Specified by:
seperate in interface Seperator

terminate

public ByteBuffer terminate(ByteBuffer source)
Specified by:
terminate in interface Seperator

translate

public P translate(ByteBuffer buffer)
Specified by:
translate in interface Translator<P>

translate

public ByteBuffer translate(P packet)
Specified by:
translate in interface Translator<P>