public class ModelBase
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
BUSY_STATE_CHANGED_NOTIFICATION |
protected boolean |
mBusy |
protected com.uk.tsl.rfid.asciiprotocol.AsciiCommander |
mCommander |
static int |
MESSAGE_NOTIFICATION |
protected android.os.Handler |
mHandler |
protected double |
mLastTaskExecutionDuration |
protected android.os.AsyncTask<java.lang.Void,java.lang.Void,java.lang.Void> |
mTaskRunner |
Constructor and Description |
---|
ModelBase() |
Modifier and Type | Method and Description |
---|---|
java.lang.Exception |
error() |
com.uk.tsl.rfid.asciiprotocol.AsciiCommander |
getCommander() |
android.os.Handler |
getHandler() |
double |
getTaskExecutionDuration() |
boolean |
isBusy() |
boolean |
isTaskRunning() |
void |
performTask(java.lang.Runnable task) |
protected void |
sendMessageNotification(java.lang.String message)
Send a message to the client using the current Handler
|
protected void |
setBusy(boolean isBusy)
Set the task busy state
|
void |
setCommander(com.uk.tsl.rfid.asciiprotocol.AsciiCommander commander) |
protected void |
setError(java.lang.Exception e) |
void |
setHandler(android.os.Handler handler) |
public static final int BUSY_STATE_CHANGED_NOTIFICATION
public static final int MESSAGE_NOTIFICATION
protected android.os.Handler mHandler
protected boolean mBusy
protected com.uk.tsl.rfid.asciiprotocol.AsciiCommander mCommander
protected android.os.AsyncTask<java.lang.Void,java.lang.Void,java.lang.Void> mTaskRunner
protected double mLastTaskExecutionDuration
public boolean isBusy()
protected void setBusy(boolean isBusy)
isBusy
- protected void sendMessageNotification(java.lang.String message)
message
- The message to send as Stringpublic boolean isTaskRunning()
public com.uk.tsl.rfid.asciiprotocol.AsciiCommander getCommander()
public void setCommander(com.uk.tsl.rfid.asciiprotocol.AsciiCommander commander)
commander
- the commander the model usespublic android.os.Handler getHandler()
public void setHandler(android.os.Handler handler)
handler
- the handler for model notificationspublic java.lang.Exception error()
protected void setError(java.lang.Exception e)
e
- the error as an exceptionpublic final double getTaskExecutionDuration()
public void performTask(java.lang.Runnable task) throws ModelException
ModelException