public class Task extends java.lang.Object implements TaskInterface
TaskInterface
,
TaskManagerInterface
,
TaskManager
,
TaskResultsInterface
,
TaskResults
,
TasksParametersInterface
,
TaskParameters
,
ClientInterface
,
Client
Constructor and Description |
---|
Task(ClientInterface owner,
int codeLang,
java.lang.String srcCode,
java.lang.String compilOpt,
boolean toRun,
java.lang.String cmdArgs,
java.lang.String stdIn)
Construct an object Task
|
Modifier and Type | Method and Description |
---|---|
ClientInterface |
getClient()
Return the ClientInterface which owns the task
|
TaskParametersInterface |
getParams()
Return the parameters of the task
|
java.lang.String |
getPath()
Return the path to the directory where the file related
to the task are saved
|
TaskResultsInterface |
getResults()
Return the results of the last execution of the task
|
java.lang.String |
getSrcFileName()
Return the name of the source file containing the code of the task
to compile/execute
|
long |
inactiveSince()
Return the time elapsed since the last time this task
have been executed
|
void |
inActivity()
Update the last activity time of this task
|
boolean |
isCompiled()
Return true if the task have been successfully compiled
|
void |
kill()
Destroy the files related to the task
|
void |
setSrcFileName(java.lang.String srcFileName)
Replace the name of the task's source file by the one given
in argument
|
public Task(ClientInterface owner, int codeLang, java.lang.String srcCode, java.lang.String compilOpt, boolean toRun, java.lang.String cmdArgs, java.lang.String stdIn)
owner
- the ClientInterface that owns the task.codeLang
- the number assigned to the langage in
which the code is written.srcCode
- the code to compile/execute contained in a string.compilOpt
- the potential options to give to
the compiler, give a empty string if there are not.toRun
- true if the task must be compiled then executed,
false if only a compilation is required.cmdArgs
- the potential arguments to give to the file
to execute, give an empty string if there are not.stdIn
- the potential standard input to give to the
file to executed, give an empty string if there is not.public ClientInterface getClient()
getClient
in interface TaskInterface
public TaskParametersInterface getParams()
getParams
in interface TaskInterface
public TaskResultsInterface getResults()
getResults
in interface TaskInterface
public long inactiveSince()
inactiveSince
in interface TaskInterface
public boolean isCompiled()
isCompiled
in interface TaskInterface
public java.lang.String getSrcFileName()
getSrcFileName
in interface TaskInterface
public void setSrcFileName(java.lang.String srcFileName)
setSrcFileName
in interface TaskInterface
srcFileName
- the new name of the task's source filepublic java.lang.String getPath()
getPath
in interface TaskInterface
public void kill()
kill
in interface TaskInterface
public void inActivity()
inActivity
in interface TaskInterface