java.lang
Enum Thread.State

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.lang.Enum sample code for java.lang.Enum definition code for java.lang.Enum <Thread.State sample code for java.lang.Thread.State definition code for java.lang.Thread.State >
      extended by java.lang.Thread.State
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable , Comparable sample code for java.lang.Comparable definition code for java.lang.Comparable <Thread.State sample code for java.lang.Thread.State definition code for java.lang.Thread.State >
Enclosing class:
Thread sample code for java.lang.Thread definition code for java.lang.Thread

public static enum Thread.State
extends Enum sample code for java.lang.Enum definition code for java.lang.Enum <Thread.State sample code for java.lang.Thread.State definition code for java.lang.Thread.State >

A thread state. A thread can be in one of the following states:

A thread can be in only one state at a given point in time. These states are virtual machine states which do not reflect any operating system thread states.

Since:
1.5
See Also:
Thread.getState() sample code for java.lang.Thread.getState() definition code for java.lang.Thread.getState()

Enum Constant Summary
BLOCKED sample code for java.lang.Thread.State.BLOCKED definition code for java.lang.Thread.State.BLOCKED
          Thread state for a thread blocked waiting for a monitor lock.
NEW sample code for java.lang.Thread.State.NEW definition code for java.lang.Thread.State.NEW
          Thread state for a thread which has not yet started.
RUNNABLE sample code for java.lang.Thread.State.RUNNABLE definition code for java.lang.Thread.State.RUNNABLE
          Thread state for a runnable thread.
TERMINATED sample code for java.lang.Thread.State.TERMINATED definition code for java.lang.Thread.State.TERMINATED
          Thread state for a terminated thread.
TIMED_WAITING sample code for java.lang.Thread.State.TIMED_WAITING definition code for java.lang.Thread.State.TIMED_WAITING
          Thread state for a waiting thread with a specified waiting time.
WAITING sample code for java.lang.Thread.State.WAITING definition code for java.lang.Thread.State.WAITING
          Thread state for a waiting thread.
 
Method Summary
static Thread.State sample code for java.lang.Thread.State definition code for java.lang.Thread.State valueOf sample code for java.lang.Thread.State.valueOf(java.lang.String) definition code for java.lang.Thread.State.valueOf(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  name)
          Returns the enum constant of this type with the specified name.
static Thread.State sample code for java.lang.Thread.State definition code for java.lang.Thread.State [] values sample code for java.lang.Thread.State.values() definition code for java.lang.Thread.State.values() ()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum sample code for java.lang.Enum definition code for java.lang.Enum
clone sample code for java.lang.Enum.clone() definition code for java.lang.Enum.clone() , compareTo sample code for java.lang.Enum.compareTo(E) definition code for java.lang.Enum.compareTo(E) , equals sample code for java.lang.Enum.equals(java.lang.Object) definition code for java.lang.Enum.equals(java.lang.Object) , getDeclaringClass sample code for java.lang.Enum.getDeclaringClass() definition code for java.lang.Enum.getDeclaringClass() , hashCode sample code for java.lang.Enum.hashCode() definition code for java.lang.Enum.hashCode() , name sample code for java.lang.Enum.name() definition code for java.lang.Enum.name() , ordinal sample code for java.lang.Enum.ordinal() definition code for java.lang.Enum.ordinal() , toString sample code for java.lang.Enum.toString() definition code for java.lang.Enum.toString() , valueOf sample code for java.lang.Enum.valueOf(java.lang.Class, java.lang.String) definition code for java.lang.Enum.valueOf(java.lang.Class, java.lang.String)
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Enum Constant Detail

NEW

public static final Thread.State sample code for java.lang.Thread.State definition code for java.lang.Thread.State  NEW
Thread state for a thread which has not yet started.


RUNNABLE

public static final Thread.State sample code for java.lang.Thread.State definition code for java.lang.Thread.State  RUNNABLE
Thread state for a runnable thread. A thread in the runnable state is executing in the Java virtual machine but it may be waiting for other resources from the operating system such as processor.


BLOCKED

public static final Thread.State sample code for java.lang.Thread.State definition code for java.lang.Thread.State  BLOCKED
Thread state for a thread blocked waiting for a monitor lock. A thread in the blocked state is waiting for a monitor lock to enter a synchronized block/method or reenter a synchronized block/method after calling Object.wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() .


WAITING

public static final Thread.State sample code for java.lang.Thread.State definition code for java.lang.Thread.State  WAITING
Thread state for a waiting thread. A thread is in the waiting state due to calling one of the following methods:

A thread in the waiting state is waiting for another thread to perform a particular action. For example, a thread that has called Object.wait() on an object is waiting for another thread to call Object.notify() or Object.notifyAll() on that object. A thread that has called Thread.join() is waiting for a specified thread to terminate.


TIMED_WAITING

public static final Thread.State sample code for java.lang.Thread.State definition code for java.lang.Thread.State  TIMED_WAITING
Thread state for a waiting thread with a specified waiting time. A thread is in the timed waiting state due to calling one of the following methods with a specified positive waiting time:


TERMINATED

public static final Thread.State sample code for java.lang.Thread.State definition code for java.lang.Thread.State  TERMINATED
Thread state for a terminated thread. The thread has completed execution.

Method Detail

values sample code for java.lang.Thread.State.values() definition code for java.lang.Thread.State.values()

public static final Thread.State sample code for java.lang.Thread.State definition code for java.lang.Thread.State [] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(Thread.State c : Thread.State.values())
        System.out.println(c);

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

valueOf sample code for java.lang.Thread.State.valueOf(java.lang.String) definition code for java.lang.Thread.State.valueOf(java.lang.String)

public static Thread.State sample code for java.lang.Thread.State definition code for java.lang.Thread.State  valueOf(String sample code for java.lang.String definition code for 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:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if this enum type has no constant with the specified name