|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.util.Observable
com.monkeycoder.monkeynetwork.ProtocolStateEngine
public abstract class ProtocolStateEngine
This is the super-class for protocol state engines. It defines both the start state and the done state.
NOTE: State IDs from 0 to 99 are reserved by this class and should NOT be used by children of this class!
| Field Summary | |
|---|---|
protected TurboBuffer |
content
The underlying TurboBuffer into which network content will be placed. |
protected java.lang.String |
fetchUri
The URI of the content to request. |
protected Network |
net
The underlying Network from which network content will be downloaded. |
protected int |
nextState
The current state of the engine. |
static int |
STATE_DONE
Assigned ending state of all ProtocolStateEngine children. |
static int |
STATE_START
Assigned starting state of all ProtocolStateEngine children. |
| Constructor Summary | |
|---|---|
ProtocolStateEngine()
Creates a ProtocolStateEngine. |
|
| Method Summary | |
|---|---|
TurboBuffer |
getContent()
Gets the TurboBuffer that was used by the state engine. |
abstract void |
run()
Multi-Threaded entry point. |
void |
setFetchUri(java.lang.String inUri)
Sets the URI of the content to fetch. |
void |
setNetwork(Network inNetwork)
Sets the network from which content will be downloaded. |
| Methods inherited from class java.util.Observable |
|---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int STATE_START
public static final int STATE_DONE
protected Network net
protected java.lang.String fetchUri
protected TurboBuffer content
protected int nextState
ProtocolStateEngine.STATE_START to kickstart their engine loop.
| Constructor Detail |
|---|
public ProtocolStateEngine()
| Method Detail |
|---|
public void setNetwork(Network inNetwork)
inNetwork - The network from which content will be downloaded.public void setFetchUri(java.lang.String inUri)
inUri - The URI of the content to fetch.public TurboBuffer getContent()
public abstract void run()
run in interface java.lang.Runnable
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||