@ Override public String convertType ( String _typeDesc , boolean useClassModel , boolean isLocal ) { if ( _typeDesc . equals ( "Z" ) || _typeDesc . equals ( "boolean" ) ) { return ( cvtBooleanToChar ) ; } else if ( _typeDesc . equals ( "[Z" ) || _typeDesc . equals ( "boolean[]" ) ) { return isLocal ? ( cvtBooleanArrayToChar ) : ( cvtBooleanArrayToCharStar ) ; } else if ( _typeDesc . equals ( "B" ) || _typeDesc . equals ( "byte" ) ) { return ( cvtByteToChar ) ; } else if ( _typeDesc . equals ( "[B" ) || _typeDesc . equals ( "byte[]" ) ) { return isLocal ? ( cvtByteArrayToChar ) : ( cvtByteArrayToCharStar ) ; } else if ( _typeDesc . equals ( "C" ) || _typeDesc . equals ( "char" ) ) { return ( cvtCharToShort ) ; } else if ( _typeDesc . equals ( "[C" ) || _typeDesc . equals ( "char[]" ) ) { return isLocal ? ( cvtCharArrayToShort ) : ( cvtCharArrayToShortStar ) ; } else if ( _typeDesc . equals ( "[I" ) || _typeDesc . equals ( "int[]" ) ) { return isLocal ? ( cvtIntArrayToInt ) : ( cvtIntArrayToIntStar ) ; } else if ( _typeDesc . equals ( "[F" ) || _typeDesc . equals ( "float[]" ) ) { return isLocal ? ( cvtFloatArrayToFloat ) : ( cvtFloatArrayToFloatStar ) ; } else if ( _typeDesc . equals ( "[D" ) || _typeDesc . equals ( "double[]" ) ) { return isLocal ? ( cvtDoubleArrayToDouble ) : ( cvtDoubleArrayToDoubleStar ) ; } else if ( _typeDesc . equals ( "[J" ) || _typeDesc . equals ( "long[]" ) ) { return isLocal ? ( cvtLongArrayToLong ) : ( cvtLongArrayToLongStar ) ; } else if ( _typeDesc . equals ( "[S" ) || _typeDesc . equals ( "short[]" ) ) { return isLocal ? ( cvtShortArrayToShort ) : ( cvtShortArrayToShortStar ) ; } else if ( "[Ljava/util/concurrent/atomic/AtomicInteger;" . equals ( _typeDesc ) || "[Ljava.util.concurrent.atomic.AtomicInteger;" . equals ( _typeDesc ) ) { return ( cvtIntArrayToIntStar ) ; } // if we get this far, we haven't matched anything yet if ( useClassModel ) { return ( ClassModel . convert ( _typeDesc , "" , true ) ) ; } else { return _typeDesc ; } }
These three convert functions are here to perform any type conversion that may be required between Java and OpenCL .