W3cubDocs

/Haxe Java

Lib

package java

Available on java

Platform-specific Java Library. Provides some platform-specific functions for the Java target, such as conversion from Haxe types to native types and vice-versa.

Static methods

staticarray<T>(native:NativeArray<T>):Array<T>

Returns a Haxe Array of a native Array. Unless copy is true, it won't copy the contents of the native array, so unless any operation triggers an array resize, all changes made to the Haxe array will affect the native array argument.

staticarrayAlloc<T>(size:Int):Array<T>

Allocates a new Haxe Array with a predetermined size

staticarray_Bool(native:NativeArray<Bool>):Array<Bool>

staticarray_Float(native:NativeArray<Float>):Array<Float>

staticarray_Int(native:NativeArray<Int>):Array<Int>

staticarray_Single(native:NativeArray<Single>):Array<Single>

staticarray_haxe_Int64(native:NativeArray<Int64>):Array<Int64>

staticarray_java_Char16(native:NativeArray<Char16>):Array<Char16>

staticarray_java_Int16(native:NativeArray<Int16>):Array<Int16>

staticarray_java_Int8(native:NativeArray<Int8>):Array<Int8>

staticinlinefromNativeType<T>(t:Class<T>):Class<T>

Returns a Class<> equivalent to the native java.lang.Class type.

staticinlinegetNativeType<T>(obj:T):Class<T>

Gets the native java.lang.Class from the supplied object. Will throw an exception in case of null being passed.

staticinlinelock<T>(obj:Dynamic, block:T):Void

Ensures that one thread does not enter a critical section of code while another thread is in the critical section. If another thread attempts to enter a locked code, it will wait, block, until the object is released. This is the equivalent to "synchronized" in java code.

This method only exists at compile-time, so it can't be called via reflection.

staticinlinenativeArray<T>(arr:Array<T>, equalLengthRequired:Bool):NativeArray<T>

Returns a native array from the supplied Array. This native array is unsafe to be written on, as it may or may not be linked to the actual Array implementation.

If equalLengthRequired is true, the result might be a copy of an array with the correct size.

staticinlinenativeType<T>(obj:T):Class<T>

Deprecated: "The function `nativeType` is deprecated and will be removed in later versions. Please use `getNativeType` instead"

Gets the native java.lang.Class from the supplied object. Will throw an exception in case of null being passed. [deprecated] - use getNativeType instead

staticinlineprint(v:Dynamic):Void

Print the specified value on the default output.

staticinlineprintln(v:Dynamic):Void

Print the specified value on the default output followed by a newline character.

staticinlinetoNativeEnum<T>(cl:Enum<T>):Class<T>

Returns a java.lang.Class equivalent to the Haxe Enum<> type.

staticinlinetoNativeType<T>(cl:Class<T>):Class<T>

Returns a java.lang.Class equivalent to the Haxe Class<> type.

© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/java/Lib.html