Prechádzať zdrojové kódy

[java] add missing methods to java.NativeString

Jens Fischer 6 rokov pred
rodič
commit
718d26f7c9
1 zmenil súbory, kde vykonal 63 pridanie a 10 odobranie
  1. 63 10
      std/java/NativeString.hx

+ 63 - 10
std/java/NativeString.hx

@@ -1,24 +1,77 @@
 package java;
 
+import haxe.Int64;
+import haxe.extern.Rest;
+import java.StdTypes.Int8;
+import java.StdTypes.Char16;
 import java.lang.CharSequence;
+import java.util.Locale;
 
 @:native("java.lang.String")
 extern class NativeString {
-	function charAt(index:Int):java.types.Char16;
+	function charAt(index:Int):Char16;
 	function codePointAt(index:Int):Int;
-	function compareTo(s:String):Int;
-	function concat(s:String):String;
+	function codePointBefore(index:Int):Int;
+	function codePointCount(beginIndex:Int, endIndex:Int):Int;
+	function compareTo(anotherString:String):Int;
+	function compareToIgnoreCase(str:String):Int;
+	function concat(str:String):String;
+	function contains(s:CharSequence):Bool;
+	@:overload function contentEquals(cs:CharSequence):Bool;
+	@:overload function contentEquals(sb:java.lang.StringBuffer):Bool;
+	@:overload static function copyValueOf(data:NativeArray<Char16>):String;
+	@:overload static function copyValueOf(data:NativeArray<Char16>, offset:Int, count:Int):String;
 	function endsWith(suffix:String):Bool;
-	function equals(obj:Dynamic):Bool;
+	function equals(anObject:Dynamic):Bool;
+	function equalsIgnoreCase(anotherString:String):Bool;
+	@:overload static function format(l:Locale, format:String, args:Rest<Dynamic>):String;
+	@:overload static function format(format:String, args:Rest<Dynamic>):String;
+	@:overload function getBytes():NativeArray<Int8>;
+	@:overload function getBytes(charset:java.nio.charset.Charset):NativeArray<Int8>;
+	@:deprecated @:overload function getBytes(srcBegin:Int, srcEnd:Int, dst:NativeArray<Int8>, dstBegin:Int):Void;
+	@:overload function getBytes(charsetName:String):NativeArray<Int8>;
+	function getChars(srcBegin:Int, srcEnd:Int, dst:NativeArray<Char16>, dstBegin:Int):Void;
 	function hashCode():Int;
-
+	@:overload function indexOf(ch:Int):Int;
+	@:overload function indexOf(ch:Int, fromIndex:Int):Int;
 	@:overload function indexOf(str:String):Int;
 	@:overload function indexOf(str:String, fromIndex:Int):Int;
-
-	function lastIndexOf(str:String, fromIndex:Int):Int;
-
-	function replace(target:CharSequence, replacement:CharSequence):String;
-	function startsWith(prefix:String):Bool;
+	function intern():String;
+	function isEmpty():Bool;
+	@:overload function lastIndexOf(ch:Int):Int;
+	@:overload function lastIndexOf(ch:Int, fromIndex:Int):Int;
+	@:overload function lastIndexOf(str:String):Int;
+	@:overload function lastIndexOf(str:String, fromIndex:Int):Int;
+	function length():Int;
+	function matches(regex:String):Bool;
+	function offsetByCodePoints(index:Int, codePointOffset:Int):Int;
+	@:overload function regionMatches(ignoreCase:Bool, toffset:Int, other:String, ooffset:Int, len:Int):Bool;
+	@:overload function regionMatches(toffset:Int, other:String, ooffset:Int, len:Int):Bool;
+	@:overload function replace(oldChar:Char16, newChar:Char16):String;
+	@:overload function replace(target:CharSequence, replacement:CharSequence):String;
+	function replaceAll(regex:String, replacement:String):String;
+	function replaceFirst(regex:String, replacement:String):String;
+	@:overload function split(regex:String):NativeArray<String>;
+	@:overload function split(regex:String, limit:Int):NativeArray<String>;
+	@:overload function startsWith(prefix:String):Bool;
+	@:overload function startsWith(prefix:String, toffset:Int):Bool;
+	function subSequence(beginIndex:Int, endIndex:Int):CharSequence;
 	@:overload function substring(beginIndex:Int):String;
 	@:overload function substring(beginIndex:Int, endIndex:Int):String;
+	function toCharArray():NativeArray<Char16>;
+	@:overload function toLowerCase():String;
+	@:overload function toLowerCase(locale:Locale):String;
+	function toString():String;
+	@:overload function toUpperCase():String;
+	@:overload function toUpperCase(locale:Locale):String;
+	function trim():String;
+	@:overload static function valueOf(b:Bool):String;
+	@:overload static function valueOf(c:Char16):String;
+	@:overload static function valueOf(data:NativeArray<Char16>):String;
+	@:overload static function valueOf(data:NativeArray<Char16>, offset:Int, count:Int):String;
+	@:overload static function valueOf(d:Float):String;
+	@:overload static function valueOf(f:String):String;
+	@:overload static function valueOf(i:Int):String;
+	@:overload static function valueOf(l:haxe.Int64):String;
+	@:overload static function valueOf(obj:java.lang.Object):String;
 }