stella.net.tpl
Class TplGet

java.lang.Object
  extended by stella.net.tpl.TplCommand
      extended by stella.net.tpl.TplGet

public class TplGet
extends TplCommand

The get command. Parses only inline data from the TplEvent.


Field Summary
private  Object datastate
          The state of the value, null OK or ERROR
static String GET
          The get command string.
static String INLINE
          The state of the reply for incoming data.
private  String lead
          The requested object.
private  Object value
          The value of the requested variable.
 
Fields inherited from class stella.net.tpl.TplCommand
ABORTED, ABORTEDBY, BUSY, COMPLETE, DENIED, DIMENSION, ERROR, FAILED, IDBUSY, INVALID, LOCKED, NOTRUNNING, OK, OVERRUN, RANGE, SYNTAX, TIMEOUT, TOOMANY, TYPE, UNKNOWN
 
Constructor Summary
TplGet(int id, String query)
          Constructs a new get command specifiying the object to retrieve.
 
Method Summary
 String getCommandLead()
          Returns the query string.
 Object getDataState()
          Returns the state of the data field.
 Object getValue()
          Returns the return value of the TPL GET command.
 boolean parseTplEvent(TplEvent reply)
          Additionally checks if the event represents the queried data.
 
Methods inherited from class stella.net.tpl.TplCommand
commenceCommand, getCommencedWhen, getID, getInfo, getState, hashCode, isAcknowledged, isCompleted, isSending, setInfo, setState, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

GET

public static final String GET
The get command string.

See Also:
Constant Field Values

INLINE

public static final String INLINE
The state of the reply for incoming data.

See Also:
Constant Field Values

value

private Object value
The value of the requested variable. String, Number or null.


datastate

private Object datastate
The state of the value, null OK or ERROR


lead

private String lead
The requested object.

Constructor Detail

TplGet

public TplGet(int id,
              String query)
Constructs a new get command specifiying the object to retrieve.

Method Detail

getCommandLead

public String getCommandLead()
Returns the query string. This is the string the command has been constructed with, preceeded by GET and a space.

Specified by:
getCommandLead in class TplCommand

getDataState

public Object getDataState()
Returns the state of the data field. If null is returned, no data is received yet. Otherwise, this retruns TplCommand.OK or TplCommand.ERROR.


getValue

public Object getValue()
Returns the return value of the TPL GET command.

Returns:
the value of the TPL GET command.

parseTplEvent

public boolean parseTplEvent(TplEvent reply)
                      throws ParseException
Additionally checks if the event represents the queried data.

Overrides:
parseTplEvent in class TplCommand
Returns:
True, if the event belongs to this command.
Throws:
ParseException