573 * Tests if the thread associated with this {@code ThreadInfo} 574 * is executing native code via the Java Native Interface (JNI). 575 * The JNI native code does not include 576 * the virtual machine support code or the compiled native 577 * code generated by the virtual machine. 578 * 579 * @return {@code true} if the thread is executing native code; 580 * {@code false} otherwise. 581 */ 582 public boolean isInNative() { 583 return inNative; 584 } 585 586 /** 587 * Tests if the thread associated with this {@code ThreadInfo} is 588 * a {@linkplain Thread#isDaemon daemon thread}. 589 * 590 * @return {@code true} if the thread is a daemon thread, 591 * {@code false} otherwise. 592 * @see Thread#isDaemon 593 * @since 1.9 594 */ 595 public boolean isDaemon() { 596 return daemon; 597 } 598 599 /** 600 * Returns the {@linkplain Thread#getPriority() thread priority} of the 601 * thread associated with this {@code ThreadInfo}. 602 * 603 * @return The priority of the thread associated with this 604 * {@code ThreadInfo}. 605 * @since 1.9 606 */ 607 public int getPriority() { 608 return priority; 609 } 610 611 /** 612 * Returns a string representation of this thread info. 613 * The format of this string depends on the implementation. 614 * The returned string will typically include 615 * the {@linkplain #getThreadName thread name}, 616 * the {@linkplain #getThreadId thread ID}, 617 * its {@linkplain #getThreadState state}, 618 * and a {@linkplain #getStackTrace stack trace} if any. 619 * 620 * @return a string representation of this thread info. 621 */ 622 public String toString() { 623 StringBuilder sb = new StringBuilder("\"" + getThreadName() + "\"" + 624 (daemon ? " daemon" : "") + 625 " prio=" + priority + | 573 * Tests if the thread associated with this {@code ThreadInfo} 574 * is executing native code via the Java Native Interface (JNI). 575 * The JNI native code does not include 576 * the virtual machine support code or the compiled native 577 * code generated by the virtual machine. 578 * 579 * @return {@code true} if the thread is executing native code; 580 * {@code false} otherwise. 581 */ 582 public boolean isInNative() { 583 return inNative; 584 } 585 586 /** 587 * Tests if the thread associated with this {@code ThreadInfo} is 588 * a {@linkplain Thread#isDaemon daemon thread}. 589 * 590 * @return {@code true} if the thread is a daemon thread, 591 * {@code false} otherwise. 592 * @see Thread#isDaemon 593 * @since 9 594 */ 595 public boolean isDaemon() { 596 return daemon; 597 } 598 599 /** 600 * Returns the {@linkplain Thread#getPriority() thread priority} of the 601 * thread associated with this {@code ThreadInfo}. 602 * 603 * @return The priority of the thread associated with this 604 * {@code ThreadInfo}. 605 * @since 9 606 */ 607 public int getPriority() { 608 return priority; 609 } 610 611 /** 612 * Returns a string representation of this thread info. 613 * The format of this string depends on the implementation. 614 * The returned string will typically include 615 * the {@linkplain #getThreadName thread name}, 616 * the {@linkplain #getThreadId thread ID}, 617 * its {@linkplain #getThreadState state}, 618 * and a {@linkplain #getStackTrace stack trace} if any. 619 * 620 * @return a string representation of this thread info. 621 */ 622 public String toString() { 623 StringBuilder sb = new StringBuilder("\"" + getThreadName() + "\"" + 624 (daemon ? " daemon" : "") + 625 " prio=" + priority + |