Small code improvements.

This commit is contained in:
MobiusDev
2017-08-28 03:19:28 +00:00
parent cfb8cc59e2
commit aec0c9dddb
114 changed files with 549 additions and 606 deletions

View File

@@ -31,18 +31,18 @@ public interface SchedulerListener
* This one is called by the scheduler when a task execution is starting.
* @param executor The task executor.
*/
public void taskLaunching(TaskExecutor executor);
void taskLaunching(TaskExecutor executor);
/**
* This one is called by the scheduler to notify that a task execution has been successfully completed.
* @param executor The task executor.
*/
public void taskSucceeded(TaskExecutor executor);
void taskSucceeded(TaskExecutor executor);
/**
* This one is called by the scheduler to notify that a task execution has failed.
* @param executor The task executor.
* @param exception The exception representing the failure notification.
*/
public void taskFailed(TaskExecutor executor, Throwable exception);
void taskFailed(TaskExecutor executor, Throwable exception);
}

View File

@@ -519,19 +519,19 @@ public class SchedulingPattern
* @return The parsed value.
* @throws Exception If the value can't be parsed.
*/
public int parse(String value) throws Exception;
int parse(String value) throws Exception;
/**
* Returns the minimum value accepred by the parser.
* @return The minimum value accepred by the parser.
*/
public int getMinValue();
int getMinValue();
/**
* Returns the maximum value accepred by the parser.
* @return The maximum value accepred by the parser.
*/
public int getMaxValue();
int getMaxValue();
}
/**

View File

@@ -33,5 +33,5 @@ public interface TaskCollector
* returned table elements, executing any task whose scheduling pattern is matching the current system time.
* @return The task table that will be automatically injected in the scheduler.
*/
public TaskTable getTasks();
TaskTable getTasks();
}

View File

@@ -32,36 +32,36 @@ public interface TaskExecutionContext
* Returns the scheduler.
* @return The scheduler.
*/
public Scheduler getScheduler();
Scheduler getScheduler();
/**
* Returns the task executor.
* @return The task executor.
*/
public TaskExecutor getTaskExecutor();
TaskExecutor getTaskExecutor();
/**
* Sets the current status tracking message, that has to be something about what the task is doing at the moment.
* @param message A message representing the current execution status. Null messages will be blanked.
*/
public void setStatusMessage(String message);
void setStatusMessage(String message);
/**
* Sets the completeness tracking value, that has to be between 0 and 1.
* @param completeness A completeness value, between 0 and 1. Values out of range will be ignored.
*/
public void setCompleteness(double completeness);
void setCompleteness(double completeness);
/**
* If the task execution has been paused, stops until the operation is resumed. It can also returns because of a stop operation without any previous resuming. Due to this the task developer should always check the {@link TaskExecutionContext#isStopped()} value after any
* <em>pauseIfRequested()</em> call. Note that a task execution can be paused only if the task {@link Task#canBePaused()} method returns <em>true</em>.
*/
public void pauseIfRequested();
void pauseIfRequested();
/**
* Checks whether the task execution has been demanded to be stopped. If the returned value is <em>true</em>, the task developer must shut down gracefully its task execution, as soon as possible. Note that a task execution can be stopped only if the task {@link Task#canBePaused()} method returns
* <em>true</em>.
* @return <em>true</em> if the current task execution has been demanded to be stopped; <em>false</em> otherwise.
*/
public boolean isStopped();
boolean isStopped();
}

View File

@@ -30,38 +30,38 @@ public interface TaskExecutorListener
* Called when the execution has been requested to be paused.
* @param executor The source executor.
*/
public void executionPausing(TaskExecutor executor);
void executionPausing(TaskExecutor executor);
/**
* Called when the execution has been requested to be resumed.
* @param executor The source executor.
*/
public void executionResuming(TaskExecutor executor);
void executionResuming(TaskExecutor executor);
/**
* Called when the executor has been requested to be stopped.
* @param executor The source executor.
*/
public void executionStopping(TaskExecutor executor);
void executionStopping(TaskExecutor executor);
/**
* Called at execution end. If the execution has failed due to an error, the encountered exception is reported.
* @param executor The source executor.
* @param exception If the execution has been terminated due to an error, this is the encountered exception; otherwise the parameter is null.
*/
public void executionTerminated(TaskExecutor executor, Throwable exception);
void executionTerminated(TaskExecutor executor, Throwable exception);
/**
* Called every time the execution status message changes.
* @param executor The source executor.
* @param statusMessage The new status message.
*/
public void statusMessageChanged(TaskExecutor executor, String statusMessage);
void statusMessageChanged(TaskExecutor executor, String statusMessage);
/**
* Called every time the execution completeness value changes.
* @param executor The source executor.
* @param completenessValue The new completeness value.
*/
public void completenessValueChanged(TaskExecutor executor, double completenessValue);
void completenessValueChanged(TaskExecutor executor, double completenessValue);
}

View File

@@ -31,5 +31,5 @@ interface ValueMatcher
* @param value The value.
* @return true if the given value matches the rules of the ValueMatcher, false otherwise.
*/
public boolean match(int value);
boolean match(int value);
}

View File

@@ -165,7 +165,7 @@ public class ExpressionBuilder
{
for (Operator o : operators)
{
this.operator(o);
operator(o);
}
return this;
}
@@ -179,7 +179,7 @@ public class ExpressionBuilder
{
for (Operator o : operators)
{
this.operator(o);
operator(o);
}
return this;
}

View File

@@ -228,7 +228,7 @@ public class Tokenizer
while (symbol.length() > 0)
{
Operator op = this.getOperator(symbol.toString());
Operator op = getOperator(symbol.toString());
if (op == null)
{
symbol.setLength(symbol.length() - 1);