org.graphstream.stream.netstream
Class DefaultNetStreamDecoder

java.lang.Object
  extended by org.graphstream.stream.netstream.DefaultNetStreamDecoder
All Implemented Interfaces:
NetStreamDecoder

public class DefaultNetStreamDecoder
extends Object
implements NetStreamDecoder


Constructor Summary
DefaultNetStreamDecoder()
           
 
Method Summary
 void decodeMessage(InputStream in)
          Decode one message.
 ThreadProxyPipe getDefaultStream()
          Gives the default stream (a ThreadProxyPipe) identified with the name "default".
 ThreadProxyPipe getStream(String name)
          Gives the stream (a ThreadProxyPipe) identified with this name.
 void register(String name, ThreadProxyPipe stream)
          Register a stream.
 void setDebugOn(boolean on)
          Enable or disable debugging.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultNetStreamDecoder

public DefaultNetStreamDecoder()
Method Detail

getStream

public ThreadProxyPipe getStream(String name)
Description copied from interface: NetStreamDecoder
Gives the stream (a ThreadProxyPipe) identified with this name. If no pipe exists under this name, a new one is created and returned

Specified by:
getStream in interface NetStreamDecoder
Parameters:
name - Identifier of the stream.
Returns:
the identified pipe

getDefaultStream

public ThreadProxyPipe getDefaultStream()
Description copied from interface: NetStreamDecoder
Gives the default stream (a ThreadProxyPipe) identified with the name "default". It is created if it does not exist.

Specified by:
getDefaultStream in interface NetStreamDecoder
Returns:
the default pipe

register

public void register(String name,
                     ThreadProxyPipe stream)
              throws Exception
Description copied from interface: NetStreamDecoder
Register a stream. All events with the given stream name will be directed to it. The user has to ensure the ThreadProxyPipe can be safely written to by the Receiver's thread.

Specified by:
register in interface NetStreamDecoder
Parameters:
name - Filter only message with this name to the given message box.
stream - The ThreadProxyPipe to push the events to.
Throws:
Exception - If another Pipe is already registered at the given name.

decodeMessage

public void decodeMessage(InputStream in)
                   throws IOException
Description copied from interface: NetStreamDecoder
Decode one message.

Specified by:
decodeMessage in interface NetStreamDecoder
Throws:
IOException

setDebugOn

public void setDebugOn(boolean on)
Description copied from interface: NetStreamDecoder
Enable or disable debugging.

Specified by:
setDebugOn in interface NetStreamDecoder


Copyright © 2013. All Rights Reserved.