com.jogamp.gluegen
Class JavaType

java.lang.Object
  extended by com.jogamp.gluegen.JavaType

public class JavaType
extends Object

Describes a java-side representation of a type that is used to represent the same data on both the Java-side and C-side during a JNI operation. Also contains some utility methods for creating common types.


Method Summary
 Object clone()
           
static JavaType createForCArray(Type elementType)
          Creates a JavaType corresponding to an array of the given element type.
static JavaType createForCCharPointer()
           
static JavaType createForCDoublePointer()
           
static JavaType createForCFloatPointer()
           
static JavaType createForCInt32Pointer()
           
static JavaType createForCInt64Pointer()
           
static JavaType createForClass(Class<?> clazz)
          Creates a JavaType corresponding to the given Java type.
static JavaType createForCShortPointer()
           
static JavaType createForCStruct(String name)
          Creates a JavaType corresponding to the specified C CompoundType name; for example, if "Foo" is supplied, then this JavaType represents a "Foo *" by way of a StructAccessor.
static JavaType createForJNIEnv()
           
static JavaType createForVoidPointer()
           
 void dump()
           
 boolean equals(Object arg)
           
static JavaType forNIOBufferClass()
           
static JavaType forNIOByteBufferArrayClass()
           
static JavaType forNIOByteBufferClass()
           
static JavaType forNIODoubleBufferClass()
           
static JavaType forNIOFloatBufferClass()
           
static JavaType forNIOIntBufferClass()
           
static JavaType forNIOLongBufferClass()
           
static JavaType forNIOPointerBufferClass()
           
static JavaType forNIOShortBufferClass()
           
 String getDescriptor()
          Returns the descriptor (internal type signature) corresponding to this type.
 String getDumpString()
           
 JavaType getElementType()
           
 Class<?> getJavaClass()
          Returns the Java Class corresponding to this type.
 String getName()
          Returns the Java type name corresponding to this type.
 int hashCode()
           
 boolean isArray()
           
 boolean isArrayOfCompoundTypeWrappers()
           
 boolean isByte()
           
 boolean isByteArray()
           
 boolean isCCharPointerType()
           
 boolean isCDoublePointerType()
           
 boolean isCFloatPointerType()
           
 boolean isCInt32PointerType()
           
 boolean isCInt64PointerType()
           
 boolean isCompoundTypeWrapper()
           
 boolean isCPrimitivePointerType()
           
 boolean isCShortPointerType()
           
 boolean isCVoidPointerType()
           
 boolean isDouble()
           
 boolean isDoubleArray()
           
 boolean isFloat()
           
 boolean isFloatArray()
           
 boolean isInt()
           
 boolean isIntArray()
           
 boolean isJNIEnv()
           
 boolean isLong()
           
 boolean isLongArray()
           
 boolean isNIOBuffer()
           
 boolean isNIOBufferArray()
           
 boolean isNIOByteBuffer()
           
 boolean isNIOByteBufferArray()
           
 boolean isNIOLongBuffer()
           
 boolean isNIOPointerBuffer()
           
 boolean isPrimitive()
           
 boolean isPrimitiveArray()
           
 boolean isShort()
           
 boolean isShortArray()
           
 boolean isString()
           
 boolean isStringArray()
           
 boolean isVoid()
           
 String jniTypeName()
          Returns the String corresponding to the JNI type for this type, or NULL if it can't be represented (i.e., it's a boxing class that we need to call getBuffer() on.)
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

equals

public boolean equals(Object arg)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getElementType

public JavaType getElementType()

createForClass

public static JavaType createForClass(Class<?> clazz)
Creates a JavaType corresponding to the given Java type. This can be used to represent arrays of primitive values or Strings; the emitters understand how to perform proper conversion from the corresponding C type.


createForCStruct

public static JavaType createForCStruct(String name)
Creates a JavaType corresponding to the specified C CompoundType name; for example, if "Foo" is supplied, then this JavaType represents a "Foo *" by way of a StructAccessor.


createForCArray

public static JavaType createForCArray(Type elementType)
Creates a JavaType corresponding to an array of the given element type. This is used to represent arrays of "Foo **" which should be mapped to Foo[] in Java.


createForVoidPointer

public static JavaType createForVoidPointer()

createForCCharPointer

public static JavaType createForCCharPointer()

createForCShortPointer

public static JavaType createForCShortPointer()

createForCInt32Pointer

public static JavaType createForCInt32Pointer()

createForCInt64Pointer

public static JavaType createForCInt64Pointer()

createForCFloatPointer

public static JavaType createForCFloatPointer()

createForCDoublePointer

public static JavaType createForCDoublePointer()

createForJNIEnv

public static JavaType createForJNIEnv()

forNIOBufferClass

public static JavaType forNIOBufferClass()

forNIOByteBufferClass

public static JavaType forNIOByteBufferClass()

forNIOShortBufferClass

public static JavaType forNIOShortBufferClass()

forNIOIntBufferClass

public static JavaType forNIOIntBufferClass()

forNIOLongBufferClass

public static JavaType forNIOLongBufferClass()

forNIOPointerBufferClass

public static JavaType forNIOPointerBufferClass()

forNIOFloatBufferClass

public static JavaType forNIOFloatBufferClass()

forNIODoubleBufferClass

public static JavaType forNIODoubleBufferClass()

forNIOByteBufferArrayClass

public static JavaType forNIOByteBufferArrayClass()

getJavaClass

public Class<?> getJavaClass()
Returns the Java Class corresponding to this type. Returns null if this object corresponds to a C primitive array type.


getName

public String getName()
Returns the Java type name corresponding to this type.


getDescriptor

public String getDescriptor()
Returns the descriptor (internal type signature) corresponding to this type.


jniTypeName

public String jniTypeName()
Returns the String corresponding to the JNI type for this type, or NULL if it can't be represented (i.e., it's a boxing class that we need to call getBuffer() on.)


isNIOBuffer

public boolean isNIOBuffer()

isNIOByteBuffer

public boolean isNIOByteBuffer()

isNIOByteBufferArray

public boolean isNIOByteBufferArray()

isNIOBufferArray

public boolean isNIOBufferArray()

isNIOLongBuffer

public boolean isNIOLongBuffer()

isNIOPointerBuffer

public boolean isNIOPointerBuffer()

isString

public boolean isString()

isArray

public boolean isArray()

isFloatArray

public boolean isFloatArray()

isDoubleArray

public boolean isDoubleArray()

isByteArray

public boolean isByteArray()

isIntArray

public boolean isIntArray()

isShortArray

public boolean isShortArray()

isLongArray

public boolean isLongArray()

isStringArray

public boolean isStringArray()

isPrimitive

public boolean isPrimitive()

isPrimitiveArray

public boolean isPrimitiveArray()

isShort

public boolean isShort()

isFloat

public boolean isFloat()

isDouble

public boolean isDouble()

isByte

public boolean isByte()

isLong

public boolean isLong()

isInt

public boolean isInt()

isVoid

public boolean isVoid()

isCompoundTypeWrapper

public boolean isCompoundTypeWrapper()

isArrayOfCompoundTypeWrappers

public boolean isArrayOfCompoundTypeWrappers()

isCPrimitivePointerType

public boolean isCPrimitivePointerType()

isCVoidPointerType

public boolean isCVoidPointerType()

isCCharPointerType

public boolean isCCharPointerType()

isCShortPointerType

public boolean isCShortPointerType()

isCInt32PointerType

public boolean isCInt32PointerType()

isCInt64PointerType

public boolean isCInt64PointerType()

isCFloatPointerType

public boolean isCFloatPointerType()

isCDoublePointerType

public boolean isCDoublePointerType()

isJNIEnv

public boolean isJNIEnv()

clone

public Object clone()
Overrides:
clone in class Object

toString

public String toString()
Overrides:
toString in class Object

getDumpString

public String getDumpString()

dump

public void dump()