java.lang
Class Class<T>

java.lang.Object
  extended by java.lang.Class<T>


public final class Class<T>
extends Object

Standard representation of a class, as specified by the standard Java API.

Compliance: CLDC: 1.0 incomplete

Compliance: J2SE: 1.4 incomplete


Method Summary
<U> Class<? extends U>
asSubclass(Class<U> clazz)
           
 T cast(Object obj)
           
 boolean desiredAssertionStatus()
           
static Class<?> forName(String className)
           
 String getCanonicalName()
           
 ClassLoader getClassLoader()
           
 Class<?> getComponentType()
           
 Constructor<?> getConstructor(Class[] parameterTypes)
           
 Constructor<?>[] getConstructors()
           
 T[] getEnumConstants()
           
 Class[] getInterfaces()
           
 Method getMethod(String name, Class[] parameterTypes)
           
 Method[] getMethods()
           
 int getModifiers()
           
 String getName()
           
 InputStream getResourceAsStream(String name)
          Returns a stream for reading a Java resource from the application's bundle file.
 String getSimpleName()
           
 Class<? super T> getSuperclass()
           
 boolean isAnonymousClass()
           
 boolean isArray()
           
 boolean isAssignableFrom(Class<?> clazz)
           
 boolean isEnum()
           
 boolean isInstance(Object obj)
           
 boolean isInterface()
           
 boolean isPrimitive()
           
 T newInstance()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

toString

public String toString()
Overrides:
toString in class Object

getName

public String getName()

cast

public T cast(Object obj)

isInterface

public boolean isInterface()

getSuperclass

public Class<? super T> getSuperclass()

getInterfaces

public Class[] getInterfaces()

isAssignableFrom

public boolean isAssignableFrom(Class<?> clazz)

isPrimitive

public boolean isPrimitive()

isArray

public boolean isArray()

isInstance

public boolean isInstance(Object obj)

desiredAssertionStatus

public boolean desiredAssertionStatus()

getModifiers

public int getModifiers()

getMethods

public Method[] getMethods()
                    throws SecurityException
Throws:
SecurityException

getMethod

public Method getMethod(String name,
                        Class[] parameterTypes)
                 throws NoSuchMethodException,
                        SecurityException
Throws:
NoSuchMethodException
SecurityException

getConstructors

public Constructor<?>[] getConstructors()
                                 throws SecurityException
Throws:
SecurityException

getConstructor

public Constructor<?> getConstructor(Class[] parameterTypes)
                              throws NoSuchMethodException,
                                     SecurityException
Throws:
NoSuchMethodException
SecurityException

newInstance

public T newInstance()
              throws InstantiationException,
                     IllegalAccessException
Throws:
InstantiationException
IllegalAccessException

getClassLoader

public ClassLoader getClassLoader()

forName

public static Class<?> forName(String className)
                        throws ClassNotFoundException
Throws:
ClassNotFoundException

getResourceAsStream

public InputStream getResourceAsStream(String name)
Returns a stream for reading a Java resource from the application's bundle file. Because resources are segregated by application, this method must be called on one of the application's classes.
Typical usage within a class of the application:
  getClass().getResourceAsStream(resourceName)
 
This example, which calls getResourceAsStream on String.class, WILL FAIL:
  "".getClass().getResourceAsStream(resourceName)
 

Parameters:
name - Path to the resource, relative to the class on which the method is called.
Returns:
A stream to that resource from the application's bundle file.

getComponentType

public Class<?> getComponentType()

isEnum

public boolean isEnum()

getEnumConstants

public T[] getEnumConstants()

asSubclass

public <U> Class<? extends U> asSubclass(Class<U> clazz)

getSimpleName

public String getSimpleName()

isAnonymousClass

public boolean isAnonymousClass()

getCanonicalName

public String getCanonicalName()