mil.navy.nps.util
Class ClassUtilities

java.lang.Object
  extended bymil.navy.nps.util.ClassUtilities

public class ClassUtilities
extends java.lang.Object


Constructor Summary
ClassUtilities()
           
 
Method Summary
static int nextSerialNum()
           
static boolean objectIsKindOfClass(java.lang.Object pObject, java.lang.Class pClass)
          Return true if class of object, or any superclass thereof, is the same as the class argument.
static boolean objectIsMemberOfClass(java.lang.Object pObject, java.lang.Class pClass)
          Returns true if the object passed in is an instance of the class passed in.
static boolean objectIsSubclassOfClass(java.lang.Object pObject, java.lang.Class pClass)
          Returns true if the object passed in is a subclass of the class passed in.
static void showActiveThreads()
          This displays the names of all the active threads in the current threadgroup.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassUtilities

public ClassUtilities()
Method Detail

nextSerialNum

public static int nextSerialNum()

showActiveThreads

public static void showActiveThreads()
This displays the names of all the active threads in the current threadgroup. It seems that, by default, all the threads in an applet/application are gathered together into one threadgroup; this displays them all. The activeCount may be off by a bit; bad the array below by a few entries so we don't get an arrayOutOfBounds error.


objectIsSubclassOfClass

public static boolean objectIsSubclassOfClass(java.lang.Object pObject,
                                              java.lang.Class pClass)
Returns true if the object passed in is a subclass of the class passed in. Returns false if the object is exactly the same class as the object passed in, or if the object is part of a different class hierarchy.


objectIsMemberOfClass

public static boolean objectIsMemberOfClass(java.lang.Object pObject,
                                            java.lang.Class pClass)
Returns true if the object passed in is an instance of the class passed in. The object must EXACTLY be the same class as the class passed in.


objectIsKindOfClass

public static boolean objectIsKindOfClass(java.lang.Object pObject,
                                          java.lang.Class pClass)
Return true if class of object, or any superclass thereof, is the same as the class argument.