SSF.OS.BGP4.Players
Class VerbosePlayer

java.lang.Object
  |
  +--SSF.Util.Streams.BasicPlayer
        |
        +--SSF.OS.BGP4.Players.AbstractPlayer
              |
              +--SSF.OS.BGP4.Players.VerbosePlayer
All Implemented Interfaces:
StreamInterface

public class VerbosePlayer
extends AbstractPlayer

Converts encoded simulation records into human-readable form which are sent to standard output.


Field Summary
 boolean usenhi
          Indicates whether or not to use NHI addressing when possible.
 
Fields inherited from class SSF.OS.BGP4.Players.AbstractPlayer
handlers
 
Constructor Summary
VerbosePlayer(java.lang.String streamID)
          Constructs a verbose player using the given stream ID.
 
Method Summary
 java.lang.String grss(int srcid)
          Not sure why, but when the inner classes below call getRecordSourceString, it always returns null.
static void main(java.lang.String[] args)
          Creates an instance of a VerbosePlayer to act on a given record stream.
 void receive(java.lang.String srcnhi, double time, byte[] buf, int bindex, int length)
          Calls an appropriate handler method given an encoded simulation record.
 
Methods inherited from class SSF.OS.BGP4.Players.AbstractPlayer
receive
 
Methods inherited from class SSF.Util.Streams.BasicPlayer
connectRead, connectWrite, disconnect, getRecordCount, getRecordSourceCode, getRecordSourceString, getRecordTypeCode, getRecordTypeString, isConnected, send, send
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

usenhi

public boolean usenhi
Indicates whether or not to use NHI addressing when possible.

Constructor Detail

VerbosePlayer

public VerbosePlayer(java.lang.String streamID)
Constructs a verbose player using the given stream ID.

Method Detail

grss

public java.lang.String grss(int srcid)
Not sure why, but when the inner classes below call getRecordSourceString, it always returns null. Not inheriting from parent class properly? So anyway, they call this method instead.


receive

public void receive(java.lang.String srcnhi,
                    double time,
                    byte[] buf,
                    int bindex,
                    int length)
Calls an appropriate handler method given an encoded simulation record. It is synchronized to protect the value of the global variable temp_nhi.

Parameters:
srcnhi - The NHI address of the source host of this record.
time - The simulation time at which the record was created.
buf - A byte array which contains the record (as well as additional bytes, maybe).
bindex - The index into the byte array at which the record begins.
length - The number of bytes in the record.
Returns:
a integer indicating whether or not the method completed successfully

main

public static void main(java.lang.String[] args)
Creates an instance of a VerbosePlayer to act on a given record stream.