/Users/andrea/_magisterarbeit/korpus/clean/testkorpus/32/file12.html NN ----------------------------------------- : Use NP arrays NNS JNI NP provides VVZ special JJ functions NNS relative JJ to TO the DT type NN to TO access VV Java NP arrays NNS . SENT This DT example NN returns VVZ the DT maximum NN of IN an DT int NP array NN . SENT JNIEXPORT NP jint NP JNICALL NP Java NP JavaHowTo NP max NP JNIEnv NP env NP , , jclass JJ obj NN , , jintArray NP arr NP int NP i NP . SENT jsize JJ len NP env NP GetArrayLength NP arr NP , , max NP 1 CD . SENT jint NN body NN env NP GetIntArrayElements NP arr NP , , 0 CD . SENT for IN max NP body NN 0 CD , , i NP 1 CD . SENT i NP ReleaseIntArrayElements NP arr NP , , body NN , , 0 CD . SENT return NN max NP . SENT The DT Java NP wrapper NN class NN JavaHowTo NP public JJ static JJ native NN int NP max NP int NP t NN . SENT static JJ System NP . SENT loadLibrary JJ javahowto NN . SENT The DT test NN program NN class NN JNIJavaHowTo NP public JJ static JJ void NN main JJ String NP args NNS int NP myArray NP 4 CD , , 7 CD , , 5 CD , , 9 CD , , 2 CD , , 0 CD , , 1 CD . SENT System NN . SENT out RB . SENT println NP JavaHowTo NP . SENT max NP myArray NP . SENT This DT following NN how WRB to IN is VBZ currently RB broken VVN . SENT . SENT . SENT Without IN passing VVG the DT array NN directly RB to TO the DT JNI NP function NN , , it's NNS possible JJ to TO fetch VV directly RB from IN the DT class NN the DT array NN . SENT JNIEXPORT NP jint NP JNICALL NP Java NP JavaHowTo NP printArray NP JNIEnv NP env NP , , jclass JJ obj NP jfieldID NN fid NN . SENT jobject NN jtab NN . SENT jsize JJ len NP . SENT int NP i NP . SENT jclass JJ cls NNS env NP GetObjectClass NP obj NP . SENT fid NN env NP GetFieldID NP cls NNS , , myArray NN , , I PP . SENT if IN fid NN 0 CD return NN . SENT jtab NP env NP GetObjectField NP obj NP , , fid NN . SENT tab NN env NP GetIntArrayElements NP jtab NP , , 0 CD . SENT len NP env NP GetArrayLength NP jtab NN . SENT printf NP int NP . SENT . SENT for IN i NP 0 CD . SENT i NP If IN you PP find VVP this DT article NN useful JJ , , consider VV making VVG a DT small JJ donation NN to TO show VV your PP$ support NN for IN this DT Web NP site NN and CC its PP$ content NN . SENT Written VVN and CC compiled VVN by IN R NP al NP Gagnon NP 1998 CD 2005 CD home NN