CharSequence
, Comparable
class NativeString extends Object implements CharSequence, Comparable
const char*
or const wchar_t*
) for use when
converting a Java String into a native memory function argument.Modifier and Type | Field | Description |
---|---|---|
(package private) static String |
WIDE_STRING |
Constructor | Description |
---|---|
NativeString(WString string) |
Create a native string as a NUL-terminated array of
wchar_t . |
NativeString(String string) |
Create a native string (NUL-terminated array of
char ). |
NativeString(String string,
boolean wide) |
Create a native string as a NUL-terminated array of
wchar_t
(if wide is true) or char . |
NativeString(String string,
String encoding) |
Create a native string (NUL-terminated array of
char ),
using the requested encoding. |
Modifier and Type | Method | Description |
---|---|---|
char |
charAt(int index) |
|
int |
compareTo(Object other) |
|
boolean |
equals(Object other) |
|
Pointer |
getPointer() |
|
int |
hashCode() |
|
int |
length() |
|
CharSequence |
subSequence(int start,
int end) |
|
String |
toString() |
chars, codePoints
static final String WIDE_STRING
public NativeString(String string)
char
).
Uses the encoding returned by Native.getDefaultStringEncoding()
.
public NativeString(String string, boolean wide)
wchar_t
(if wide
is true) or char
.
If not wide
, the encoding is obtained from Native.getDefaultStringEncoding()
.
string
- value to write to native memorywide
- whether to store the String as wchar_t
public NativeString(WString string)
wchar_t
.public String toString()
toString
in interface CharSequence
toString
in class Object
public Pointer getPointer()
public char charAt(int index)
charAt
in interface CharSequence
public int length()
length
in interface CharSequence
public CharSequence subSequence(int start, int end)
subSequence
in interface CharSequence
public int compareTo(Object other)
compareTo
in interface Comparable