| 1 | // Object.java - The root of all evil.
|
|---|
| 2 |
|
|---|
| 3 | /* Copyright (C) 1998, 1999, 2000 Free Software Foundation
|
|---|
| 4 |
|
|---|
| 5 | This file is part of libgcj.
|
|---|
| 6 |
|
|---|
| 7 | This software is copyrighted work licensed under the terms of the
|
|---|
| 8 | Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
|
|---|
| 9 | details. */
|
|---|
| 10 |
|
|---|
| 11 | package java.lang;
|
|---|
| 12 |
|
|---|
| 13 | /**
|
|---|
| 14 | * @author Tom Tromey <[email protected]>
|
|---|
| 15 | * @date September 30, 1998
|
|---|
| 16 | */
|
|---|
| 17 |
|
|---|
| 18 | /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
|
|---|
| 19 | * "The Java Language Specification", ISBN 0-201-63451-1
|
|---|
| 20 | * plus online API docs for JDK 1.2 beta from http://www.javasoft.com.
|
|---|
| 21 | * plus gcj compiler sources (to determine object layout)
|
|---|
| 22 | * Status: Complete to version 1.1
|
|---|
| 23 | */
|
|---|
| 24 |
|
|---|
| 25 | public class Object
|
|---|
| 26 | {
|
|---|
| 27 | // This must come first. See _JvObjectPrefix in Object.h.
|
|---|
| 28 | protected void finalize () throws Throwable
|
|---|
| 29 | {
|
|---|
| 30 | }
|
|---|
| 31 |
|
|---|
| 32 | public final native Class getClass ();
|
|---|
| 33 | public native int hashCode ();
|
|---|
| 34 | public final native void notify ();
|
|---|
| 35 | public final native void notifyAll ();
|
|---|
| 36 | public final native void wait (long timeout, int nanos)
|
|---|
| 37 | throws InterruptedException;
|
|---|
| 38 |
|
|---|
| 39 | public boolean equals (Object obj)
|
|---|
| 40 | {
|
|---|
| 41 | return this == obj;
|
|---|
| 42 | }
|
|---|
| 43 |
|
|---|
| 44 | public Object ()
|
|---|
| 45 | {
|
|---|
| 46 | }
|
|---|
| 47 |
|
|---|
| 48 | public String toString ()
|
|---|
| 49 | {
|
|---|
| 50 | return getClass().getName() + '@' + Integer.toHexString(hashCode());
|
|---|
| 51 | }
|
|---|
| 52 |
|
|---|
| 53 | public final void wait () throws InterruptedException
|
|---|
| 54 | {
|
|---|
| 55 | wait (0, 0);
|
|---|
| 56 | }
|
|---|
| 57 |
|
|---|
| 58 | public final void wait (long timeout) throws InterruptedException
|
|---|
| 59 | {
|
|---|
| 60 | wait (timeout, 0);
|
|---|
| 61 | }
|
|---|
| 62 |
|
|---|
| 63 | protected native Object clone () throws CloneNotSupportedException;
|
|---|
| 64 |
|
|---|
| 65 | // This initializes the sync_info member. It is here for
|
|---|
| 66 | // completeness (some day we'll be able to auto-generate Object.h).
|
|---|
| 67 | private final native void sync_init ();
|
|---|
| 68 |
|
|---|
| 69 | // Note that we don't mention the sync_info field here. If we do,
|
|---|
| 70 | // jc1 will not work correctly.
|
|---|
| 71 | }
|
|---|