org.gjt.sp.util
Enum TaskManager

java.lang.Object
  extended by java.lang.Enum<TaskManager>
      extended by org.gjt.sp.util.TaskManager
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<TaskManager>

public enum TaskManager
extends java.lang.Enum<TaskManager>

The TaskManager manage Tasks in the Threadpool, it knows all of them, and sends events to TaskListeners.


Nested Class Summary
static interface TaskManager.TaskVisitor
           
 
Enum Constant Summary
INSTANCE
           
 
Method Summary
 void addTaskListener(TaskListener listener)
           
 int countIoTasks()
          Return the number of IO tasks in queue.
 int countTasks()
          Return the number of tasks in queue.
 void removeTaskListener(TaskListener listener)
           
static TaskManager valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static TaskManager[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 void visit(TaskManager.TaskVisitor visitor)
          Visit all tasks.
 void waitForIoTasks()
           
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

INSTANCE

public static final TaskManager INSTANCE
Method Detail

values

public static TaskManager[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (TaskManager c : TaskManager.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static TaskManager valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

countTasks

public int countTasks()
Return the number of tasks in queue.

Returns:
the number of tasks in queue
Since:
jEdit 4.5pre1

countIoTasks

public int countIoTasks()
Return the number of IO tasks in queue.

Returns:
the number of IO tasks in queue
Since:
jEdit 5.1pre1

addTaskListener

public void addTaskListener(TaskListener listener)

removeTaskListener

public void removeTaskListener(TaskListener listener)

visit

public void visit(TaskManager.TaskVisitor visitor)
Visit all tasks. While doing this the task list is locked

Parameters:
visitor - the visitor

waitForIoTasks

public void waitForIoTasks()