Interface IStringJavaObject
- Namespace
- MASES.JCOBridge.C2JBridge.JVMInterop
- Assembly
- C2JBridge.dll
Interface to manage JVM string objects without move the memory between CLR and JVM
public interface IStringJavaObject
- Extension Methods
Properties
IsNullOrEmpty
Indicates whether the specified string is null or an Empty string.
bool IsNullOrEmpty { get; }
Property Value
- bool
true if the
valueparameter is null or an empty string (""); otherwise, false.
Exceptions
- InvalidOperationException
If current instance is not a JVM string
IsNullOrWhiteSpace
Indicates whether a specified string is null, empty, or consists only of white-space characters.
bool IsNullOrWhiteSpace { get; }
Property Value
- bool
true if the
valueparameter is null or Empty, or ifvalueconsists exclusively of white-space characters.
Exceptions
- InvalidOperationException
If current instance is not a JVM string
Methods
CompareTo(string)
Compares this instance with a specified string object and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified string.
int CompareTo(string strB)
Parameters
strBstringThe string to compare with this instance.
Returns
- int
A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the
strBparameter.Value Condition Less than zero This instance precedesstrB. Zero This instance has the same position in the sort order asstrB. Greater than zero This instance followsstrB.-or-strBis null.
Exceptions
- InvalidOperationException
If current instance is not a JVM string
Contains(char)
Returns a value indicating whether a specified substring occurs within this string.
bool Contains(char value)
Parameters
valuecharThe string to seek.
Returns
- bool
true if the
valueparameter occurs within this string, or ifvalueis the empty string (""); otherwise, false.
Exceptions
- ArgumentNullException
valueis null.- InvalidOperationException
If current instance is not a JVM string
Contains(string)
Returns a value indicating whether a specified substring occurs within this string.
bool Contains(string value)
Parameters
valuestringThe string to seek.
Returns
- bool
true if the
valueparameter occurs within this string, or ifvalueis the empty string (""); otherwise, false.
Exceptions
- ArgumentNullException
valueis null.- InvalidOperationException
If current instance is not a JVM string
EndsWith(string)
Determines whether the end of this string instance matches the specified string.
bool EndsWith(string value)
Parameters
valuestringThe string to compare to the substring at the end of this instance.
Returns
- bool
true if
valuematches the end of this instance; otherwise, false.
Exceptions
- ArgumentNullException
valueis null.- InvalidOperationException
If current instance is not a JVM string
Equals(string)
Determines whether this instance and another specified string object have the same value.
bool Equals(string value)
Parameters
valuestringThe string to compare to this instance.
Returns
- bool
true if the value of the
valueparameter is the same as the value of this instance; otherwise, false. Ifvalueis null, the method returns false.
Exceptions
- InvalidOperationException
If current instance is not a JVM string
IndexOf(char)
Reports the zero-based index of the first occurrence of the specified Unicode character in this string.
int IndexOf(char value)
Parameters
valuecharA Unicode character to seek.
Returns
- int
The zero-based index position of
valueif that character is found, or -1 if it is not.
Exceptions
- InvalidOperationException
If current instance is not a JVM string
IndexOf(string)
Reports the zero-based index of the first occurrence of the specified string in this instance.
int IndexOf(string value)
Parameters
valuestringThe string to seek.
Returns
- int
The zero-based index position of
valueif that string is found, or -1 if it is not. Ifvalueis Empty, the return value is 0.
Exceptions
- ArgumentNullException
valueis null.- InvalidOperationException
If current instance is not a JVM string
IndexOfAny(char[])
Reports the zero-based index of the first occurrence in this instance of any character in a specified array of Unicode characters.
int IndexOfAny(char[] anyOf)
Parameters
anyOfchar[]A Unicode character array containing one or more characters to seek.
Returns
- int
The zero-based index position of the first occurrence in this instance where any character in
anyOfwas found; -1 if no character inanyOfwas found.
Exceptions
- ArgumentNullException
anyOfis null.- InvalidOperationException
If current instance is not a JVM string
LastIndexOf(char)
Reports the zero-based index position of the last occurrence of a specified Unicode character within this instance.
int LastIndexOf(char value)
Parameters
valuecharThe Unicode character to seek.
Returns
- int
The zero-based index position of
valueif that character is found, or -1 if it is not.
Exceptions
- InvalidOperationException
If current instance is not a JVM string
LastIndexOf(string)
Reports the zero-based index position of the last occurrence of a specified string within this instance.
int LastIndexOf(string value)
Parameters
valuestringThe string to seek.
Returns
- int
The zero-based starting index position of
valueif that string is found, or -1 if it is not. Ifvalueis Empty, the return value is the last index position in this instance.
Exceptions
- ArgumentNullException
valueis null.- InvalidOperationException
If current instance is not a JVM string
LastIndexOfAny(char[])
Reports the zero-based index position of the last occurrence in this instance of one or more characters specified in a Unicode array.
int LastIndexOfAny(char[] anyOf)
Parameters
anyOfchar[]A Unicode character array containing one or more characters to seek.
Returns
- int
The index position of the last occurrence in this instance where any character in
anyOfwas found; -1 if no character inanyOfwas found.
Exceptions
- ArgumentNullException
anyOfis null.- InvalidOperationException
If current instance is not a JVM string
StartsWith(string)
Determines whether the beginning of this string instance matches the specified string.
bool StartsWith(string value)
Parameters
valuestringThe string to compare.
Returns
- bool
true if
valuematches the beginning of this string; otherwise, false.
Exceptions
- ArgumentNullException
valueis null.- InvalidOperationException
If current instance is not a JVM string