|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgcspy.comm.CommandStream
gcspy.interpreter.Interpreter
public abstract class Interpreter
Facilities shared by the client and server interpreters
Nested Class Summary | |
---|---|
protected class |
Interpreter.BootstrapParameters
Inner Classes |
Field Summary | |
---|---|
protected Client |
client
The client |
protected static byte |
CONTROL_CMD
Start new control stream command |
protected static int |
DEFAULT_MAX_LEN
|
protected static byte |
EVENT_CMD
Event occurred command |
protected static byte |
EVENT_COUNT_CMD
Event count command |
protected static byte |
EVENT_FILTERS_CMD
Event filters command |
protected int[] |
eventCount
Counts of each event |
protected EventFilters |
eventFilters
The event filters |
protected Events |
events
The events |
protected java.lang.String |
generalInfo
General information presented to the client |
protected java.lang.String |
name
The name of the interpreter |
protected static byte |
PAUSE_CMD
Server has paused command |
protected static byte |
PAUSE_REQ_CMD
Client has requested pause command |
protected static byte |
PLAY_ONE_CMD
Client has requested play one event command |
protected static byte |
RESTART_CMD
Client has requested restart command |
protected static byte |
SHUTDOWN_CMD
Server has shut down command |
protected static byte |
SHUTDOWN_REQ_CMD
Client has requested shutdown command |
protected static byte |
SPACE_CMD
Space command |
protected static byte |
SPACE_INFO_CMD
Space information command |
protected int |
spaceNum
The number of spaces |
protected Space[] |
spaces
The spaces |
protected static byte |
STREAM_CMD
Start new stream command |
protected static byte |
SUMMARY_CMD
Summary information command |
Fields inherited from class gcspy.comm.CommandStream |
---|
cmds, FIRST_AVAILABLE_CMD, max, output |
Constructor Summary | |
---|---|
Interpreter()
Create an interpreter |
|
Interpreter(java.lang.String name)
Create an interpreter |
Method Summary | |
---|---|
void |
deserialise(BufferedInput input)
S Deserialise the space number, the general information and the events |
void |
deserialiseEverything(InputGenerator generator)
Deserialise everything (space number, general information, events, spaces) |
void |
dump()
Debugging |
void |
dumpSpaces()
|
int[] |
getEventCount()
Get the counts for each event |
EventFilters |
getEventFilters()
Get the event filters |
Events |
getEvents()
Get the events |
java.lang.String |
getGeneralInfo()
Get the general information for this interpreter |
java.lang.String |
getName()
Get the interpreter's name |
Space |
getSpace(int i)
Return a space |
int |
getSpaceNum()
Get the number of spaces |
protected void |
println(int type,
java.lang.String text)
Print a message |
protected void |
receiveBootInfo(boolean server,
Interpreter.BootstrapParameters params)
Receive boot information |
protected void |
sendBootInfo(boolean server,
Interpreter.BootstrapParameters params)
Send boot information |
protected void |
sendSingleCommand(byte cmd)
Send a single command |
void |
serialise(BufferedOutput output)
Serialise the space number, the general information and the events |
void |
serialiseEverything(OutputGenerator generator)
Serialise everything (space number, general information, events, spaces) |
void |
setEventCount(int[] eventCount)
Set the event counts |
void |
setGeneralInfo(java.lang.String generalInfo)
Set the general information |
void |
setSpace(Space space)
Set one space |
protected void |
setupEventCount()
Setup counts of events for all events |
protected void |
setupEventFilters()
Setup the event filters for all events |
void |
setVerbose(boolean v)
Set verbosity |
Methods inherited from class gcspy.comm.CommandStream |
---|
execute, finish, finish, getCmd, putCmd, putCmd, setBufferedOutput, start, start |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int DEFAULT_MAX_LEN
protected java.lang.String name
protected Client client
protected Space[] spaces
protected int spaceNum
protected Events events
protected EventFilters eventFilters
protected int[] eventCount
protected java.lang.String generalInfo
protected static final byte PAUSE_REQ_CMD
protected static final byte PAUSE_CMD
protected static final byte RESTART_CMD
protected static final byte PLAY_ONE_CMD
protected static final byte SHUTDOWN_REQ_CMD
protected static final byte SHUTDOWN_CMD
protected static final byte STREAM_CMD
protected static final byte EVENT_CMD
protected static final byte CONTROL_CMD
protected static final byte EVENT_FILTERS_CMD
protected static final byte EVENT_COUNT_CMD
protected static final byte SUMMARY_CMD
protected static final byte SPACE_INFO_CMD
protected static final byte SPACE_CMD
Constructor Detail |
---|
public Interpreter()
public Interpreter(java.lang.String name)
name
- The nane of the interpreterMethod Detail |
---|
public void setVerbose(boolean v)
v
- verbosity on/offpublic void setEventCount(int[] eventCount)
eventCount
- The event countspublic void setGeneralInfo(java.lang.String generalInfo)
generalInfo
- the general informationpublic void setSpace(Space space)
space
- the spacepublic java.lang.String getName()
public int getSpaceNum()
public Space getSpace(int i)
i
- The space's ID
public Events getEvents()
public EventFilters getEventFilters()
public int[] getEventCount()
public java.lang.String getGeneralInfo()
protected void sendSingleCommand(byte cmd) throws java.io.IOException
cmd
- the command to send
java.io.IOException
protected void println(int type, java.lang.String text)
type
- 0 for server, 1 for clienttext
- the messageprotected void sendBootInfo(boolean server, Interpreter.BootstrapParameters params) throws java.io.IOException
server
- True if this is the serverparams
- the BootStrapParameters
java.io.IOException
protected void receiveBootInfo(boolean server, Interpreter.BootstrapParameters params) throws java.io.IOException
server
- True if this is the serverparams
- the BootStrapParameters
java.io.IOException
InterpreterException
- if magic string or endianness do not matchpublic void serialise(BufferedOutput output)
output
- the BufferedOutput on which to serialisepublic void deserialise(BufferedInput input)
input
- the BufferedInput from which to deserialisepublic void serialiseEverything(OutputGenerator generator) throws java.io.IOException
generator
- A generator that will create a new BufferedOutput
java.io.IOException
public void deserialiseEverything(InputGenerator generator) throws java.io.IOException
generator
- A generator that will create a new BufferedInput
java.io.IOException
public void dump()
public void dumpSpaces()
protected void setupEventFilters()
protected void setupEventCount()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |