Enum ThreadState

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      BLOCKED
      The current thread is blocked on a monitor.
      NETIO
      The current thread is in a Net IO operation.
      RUNNABLE
      The current thread is runnable.
      WAITING
      The current thread is waiting.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void enter()
      Enters a thread state.
      static void exit()
      Exists the current override state and resets the state to the value reported by the JVM.
      static ThreadState valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ThreadState[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • 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

      • RUNNABLE

        public static final ThreadState RUNNABLE
        The current thread is runnable.
      • WAITING

        public static final ThreadState WAITING
        The current thread is waiting.
      • BLOCKED

        public static final ThreadState BLOCKED
        The current thread is blocked on a monitor.
      • NETIO

        public static final ThreadState NETIO
        The current thread is in a Net IO operation.
    • Method Detail

      • values

        public static ThreadState[] 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 (ThreadState c : ThreadState.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ThreadState 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
      • enter

        public void enter()
        Enters a thread state. This state will be recorded until the matching exit is called.
      • exit

        public static void exit()
        Exists the current override state and resets the state to the value reported by the JVM.