public abstract class NativePhysicsObject extends java.lang.Object implements java.lang.Comparable<NativePhysicsObject>
| Modifier and Type | Field and Description |
|---|---|
static java.util.logging.Logger |
loggerN
message logger for this class
|
| Modifier | Constructor and Description |
|---|---|
protected |
NativePhysicsObject()
Instantiate with no tracker and no assigned native object.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(NativePhysicsObject other)
Compare (by ID) with another native object.
|
static int |
countTrackers()
Count how many native objects are being tracked.
|
static void |
dumpTrackers()
Dump all native-object trackers to
System.out. |
boolean |
equals(java.lang.Object otherObject)
Test for ID equality with another object.
|
static void |
freeUnusedObjects()
Free any assigned native objects that are known to be unused.
|
boolean |
hasAssignedNativeObject()
Test whether a native object is assigned to this instance.
|
int |
hashCode()
Return the hash code for this instance.
|
long |
nativeId()
Return the ID of the assigned native object, assuming that one is
assigned.
|
protected void |
reassignNativeId(long nativeId)
Assign a tracked native object to this instance, unassigning (but not
freeing) any previously assigned one.
|
protected void |
setNativeId(long nativeId)
Assign a tracked native object to this instance, assuming that no native
object is assigned.
|
protected void |
setNativeIdNotTracked(long nativeId)
Assign an untracked native object to this instance, assuming that no
native object is assigned.
|
java.lang.String |
toString()
Represent this instance as a String.
|
protected void |
unassignNativeObject()
Unassign (but don't free) the assigned native object, assuming that one
is assigned.
|
public static final java.util.logging.Logger loggerN
protected NativePhysicsObject()
This no-arg constructor was made explicit to avoid javadoc warnings from JDK 18+.
public static final int countTrackers()
public static final void dumpTrackers()
System.out. This method is
intended for debugging.public static final void freeUnusedObjects()
public final boolean hasAssignedNativeObject()
public long nativeId()
protected final void reassignNativeId(long nativeId)
nativeId - the identifier of the native object to assign (not zero)protected void setNativeId(long nativeId)
nativeId - the identifier of the native object to assign (not zero)protected final void setNativeIdNotTracked(long nativeId)
nativeId - the identifier of the native object to assign (not zero)protected final void unassignNativeObject()
public int compareTo(NativePhysicsObject other)
compareTo in interface java.lang.Comparable<NativePhysicsObject>other - (not null, unaffected)public boolean equals(java.lang.Object otherObject)
equals in class java.lang.ObjectotherObject - the object to compare (may be null, unaffected)this and otherObject have the same ID,
otherwise falsepublic int hashCode()
Note: operations that alter the native ID are likely to affect the hash code as well!
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object