396
397 @Override
398 public String toString() {
399 return Long.toString(pid);
400 }
401
402 @Override
403 public int hashCode() {
404 return Long.hashCode(pid);
405 }
406
407 @Override
408 public boolean equals(Object obj) {
409 return (obj instanceof ProcessHandleImpl) &&
410 (pid == ((ProcessHandleImpl) obj).pid);
411 }
412
413 /**
414 * Implementation of ProcessHandle.Info.
415 * Information snapshot about a process.
416 * The attributes of a process vary by operating system and not available
417 * in all implementations. Additionally, information about other processes
418 * is limited by the operating system privileges of the process making the request.
419 * If a value is not available, either a {@code null} or {@code -1} is stored.
420 * The accessor methods return {@code null} if the value is not available.
421 */
422 static class Info implements ProcessHandle.Info {
423 static {
424 initIDs();
425 }
426
427 /**
428 * Initialization of JNI fieldIDs.
429 */
430 private static native void initIDs();
431
432 /**
433 * Fill in this Info instance with information about the native process.
434 * If values are not available the native code does not modify the field.
435 * @param pid of the native process
436 */
|
396
397 @Override
398 public String toString() {
399 return Long.toString(pid);
400 }
401
402 @Override
403 public int hashCode() {
404 return Long.hashCode(pid);
405 }
406
407 @Override
408 public boolean equals(Object obj) {
409 return (obj instanceof ProcessHandleImpl) &&
410 (pid == ((ProcessHandleImpl) obj).pid);
411 }
412
413 /**
414 * Implementation of ProcessHandle.Info.
415 * Information snapshot about a process.
416 * The attributes of a process vary by operating system and are not available
417 * in all implementations. Additionally, information about other processes
418 * is limited by the operating system privileges of the process making the request.
419 * If a value is not available, either a {@code null} or {@code -1} is stored.
420 * The accessor methods return {@code null} if the value is not available.
421 */
422 static class Info implements ProcessHandle.Info {
423 static {
424 initIDs();
425 }
426
427 /**
428 * Initialization of JNI fieldIDs.
429 */
430 private static native void initIDs();
431
432 /**
433 * Fill in this Info instance with information about the native process.
434 * If values are not available the native code does not modify the field.
435 * @param pid of the native process
436 */
|