private void insertToListeners( Command cmd ) { MasterProcessCommand expectedCommandType = cmd.getCommandType(); for ( BiProperty<MasterProcessCommand, CommandListener> listenerWrapper : CommandReader.this.listeners ) { MasterProcessCommand commandType = listenerWrapper.getP1(); CommandListener listener = listenerWrapper.getP2(); if ( commandType == null || commandType == expectedCommandType ) { listener.update( cmd ); } } }
private void insertToListeners( Command cmd ) { MasterProcessCommand expectedCommandType = cmd.getCommandType(); for ( BiProperty<MasterProcessCommand, CommandListener> listenerWrapper : CommandReader.this.listeners ) { MasterProcessCommand commandType = listenerWrapper.getP1(); CommandListener listener = listenerWrapper.getP2(); if ( commandType == null || commandType == expectedCommandType ) { listener.update( cmd ); } } }
switch ( command.getCommandType() )
switch ( command.getCommandType() )
MasterProcessCommand cmdType = cmd.getCommandType(); currentBuffer = cmdType.hasDataType() ? cmdType.encode( cmd.getData() ) : cmdType.encode();
MasterProcessCommand cmdType = cmd.getCommandType(); currentBuffer = cmdType.hasDataType() ? cmdType.encode( cmd.getData() ) : cmdType.encode();