Overview  Package   Class  Tree  Index 

be.lassi.lanbox.commands
Class LanboxCommand

java.lang.Object
  extended by be.lassi.lanbox.commands.Command
      extended by be.lassi.lanbox.commands.LanboxCommand
Direct Known Subclasses:
ChannelReadData, ChannelReadStatus, ChannelSetAttribute, ChannelSetData, Common16BitMode, CommonEraseAll, CommonGet16BitTable, CommonGetCurve, CommonGetCurveTable1, CommonGetCurveTable2, CommonGetCurveTable3, CommonGetCurveTable4, CommonGetCurveTable5, CommonGetCurveTable6, CommonGetCurveTable7, CommonGetDirectory, CommonGetGain, CommonGetLayers, CommonGetMIDIMapping, CommonGetPatch, CommonGetQuestion, CommonGetSlope, CommonLoadAll, CommonSaveAll, CommonSet16BitTable, CommonSetCurve, CommonSetCurveTable1, CommonSetCurveTable2, CommonSetCurveTable3, CommonSetCurveTable4, CommonSetCurveTable5, CommonSetCurveTable6, CommonSetCurveTable7, CommonSetDMXIn, CommonSetDmxOffset, CommonSetGain, CommonSetIPConfig, CommonSetMIDI, CommonSetMIDIMapping, CommonSetName, CommonSetNumDmx, CommonSetPassw, CommonSetPatch, CommonSetSlope, CommonStore16BitTable, CommonStoreMIDIMapping, CommonStorePostTable, CueListCreate, CueListRead, CueListRemove, CueListRemoveStep, CueListWrite, CueSceneRead, CueSceneWrite, GetCueListUsage, GetFreeList, GetTotalUsage, LayerCommand, LayerConfigure, LayerGetGlobalData, LayerInsertAppendStep, LayerReplaceStep, LayerSetAutoOutput, LayerSetCueListWait, LayerSetCueStepData1, LayerSetCueStepData2, LayerSetCueStepData3, LayerSetCueStepData4, LayerSetCueStepData5, LayerSetCueStepData6, LayerSetCueStepDataType, LayerSetDeviceID, LayerSetIgnoreNoteOff, LayerSetLocked, LayerSetRelativeScene, LayerSetSustain, LayerUsesCueList, NoteOff, UnknownCommand

public class LanboxCommand
extends Command


Constructor Summary
LanboxCommand(byte[] request)
          Constructs a new command.
LanboxCommand(java.lang.String template)
          Constructs a new command.
LanboxCommand(java.lang.String id, int length)
          Constructs a new command.
 
Method Summary
 boolean equals(java.lang.Object object)
          
protected  byte[] get(int start, int length)
           
protected  boolean getBoolean(int offset)
          Gets a boolean value from 2 bytes in the request buffer.
 java.lang.String getId()
          Gets the command identifier.
protected  int getInt(int offset)
          Gets an integer value from 2 bytes in the request buffer.
protected  int getInt4(int offset)
          Gets an integer value from 4 bytes in the request buffer.
 byte[] getRequest()
          Gets the request buffer.
 java.lang.String getRequestString()
          Gets the request buffer in string format.
 byte[] getResponse()
          Gets the response buffer.
 void processResponse(byte[] responseBuffer)
          Processes given reponse buffer.
protected  void set(int offset, byte value)
          Sets a byte value at given offset in the request buffer.
protected  void set2(int offset, boolean value)
          Sets an boolean at given offset in the request buffer.
protected  void set2(int offset, int value)
          Sets an integer value occupying 2 bytes at given offset in the request buffer.
protected  void set4(int offset, int value)
          Sets an integer value occupying 4 bytes at given offset in the request buffer.
 
Methods inherited from class be.lassi.lanbox.commands.Command
add, appendCommand, appendCommandDetail, appendResponse, getCommandString, hashCode, notifyListeners, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LanboxCommand

public LanboxCommand(byte[] request)
Constructs a new command.

Parameters:
request - the request buffer from which to construct the command

LanboxCommand

public LanboxCommand(java.lang.String template)
Constructs a new command. The command identifier and the request buffer length are derived from given command template string.

Parameters:
template - the command template

LanboxCommand

public LanboxCommand(java.lang.String id,
                     int length)
Constructs a new command.

Parameters:
id - the command identifier
length - the length of the request buffer
Method Detail

equals

public boolean equals(java.lang.Object object)

Overrides:
equals in class java.lang.Object

get

protected byte[] get(int start,
                     int length)

getBoolean

protected boolean getBoolean(int offset)
Gets a boolean value from 2 bytes in the request buffer.

Parameters:
offset - the offset of the boolean value in the request buffer
Returns:
the boolean value

getId

public java.lang.String getId()
Gets the command identifier.

Returns:
the command identifier

getInt

protected int getInt(int offset)
Gets an integer value from 2 bytes in the request buffer.

Parameters:
offset - the offset of the integer value in the request buffer
Returns:
the integer value

getInt4

protected int getInt4(int offset)
Gets an integer value from 4 bytes in the request buffer.

Parameters:
offset - the offset of the integer value in the request buffer
Returns:
the integer value

getRequest

public byte[] getRequest()
Gets the request buffer.

Returns:
the request buffer

getRequestString

public java.lang.String getRequestString()
Gets the request buffer in string format.

Returns:
the request buffer in string format

getResponse

public byte[] getResponse()
Gets the response buffer.

Returns:
the response buffer

processResponse

public void processResponse(byte[] responseBuffer)
Processes given reponse buffer.

Parameters:
responseBuffer - the response buffer to be processed

set

protected void set(int offset,
                   byte value)
Sets a byte value at given offset in the request buffer.

Parameters:
offset - the offset in the request buffer
value - the value to set

set2

protected void set2(int offset,
                    boolean value)
Sets an boolean at given offset in the request buffer.

Parameters:
offset - the offset in the request buffer
value - the value to set

set2

protected void set2(int offset,
                    int value)
Sets an integer value occupying 2 bytes at given offset in the request buffer.

Parameters:
offset - the offset in the request buffer
value - the value to set

set4

protected void set4(int offset,
                    int value)
Sets an integer value occupying 4 bytes at given offset in the request buffer.

Parameters:
offset - the offset in the request buffer
value - the value to set

Overview  Package   Class  Tree  Index 
Lighting Assistant 1.2