
system.text.Rune Maven / Gradle / Ivy
/*
* MIT License
*
* Copyright (c) 2023 MASES s.r.l.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/**************************************************************************************
*
* This code was generated from a template using JCOReflector
*
* Manual changes to this file may cause unexpected behavior in your application.
* Manual changes to this file will be overwritten if the code is regenerated.
*
*************************************************************************************/
package system.text;
import org.mases.jcobridge.*;
import org.mases.jcobridge.netreflection.*;
import java.util.ArrayList;
// Import section
import system.ValueType;
import system.UInt32;
import system.text.Rune;
import system.buffers.OperationStatus;
import system.globalization.UnicodeCategory;
import system.globalization.CultureInfo;
import system.IFormatProvider;
import system.IFormatProviderImplementation;
import system.IComparable;
import system.IComparableImplementation;
import system.IFormattable;
import system.IFormattableImplementation;
/**
* The base .NET class managing System.Text.Rune, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e.
*
*
* .NET documentation at https://docs.microsoft.com/en-us/dotnet/api/System.Text.Rune
*
*
* Powered by JCOBridge: more info at https://www.jcobridge.com
*/
public class Rune extends ValueType implements system.IComparable, system.IFormattable {
/**
* Fully assembly qualified name: System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
*/
public static final String assemblyFullName = "System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e";
/**
* Assembly name: System.Private.CoreLib
*/
public static final String assemblyShortName = "System.Private.CoreLib";
/**
* Qualified class name: System.Text.Rune
*/
public static final String className = "System.Text.Rune";
static JCOBridge bridge = JCOBridgeInstance.getInstance(assemblyFullName);
/**
* The type managed from JCOBridge. See {@link JCType}
*/
public static JCType classType = createType();
static JCEnum enumInstance = null;
JCObject classInstance = null;
static JCType createType() {
try {
String classToCreate = className + ", "
+ (JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
if (JCOReflector.getDebug())
JCOReflector.writeLog("Creating %s", classToCreate);
JCType typeCreated = bridge.GetType(classToCreate);
if (JCOReflector.getDebug())
JCOReflector.writeLog("Created: %s",
(typeCreated != null) ? typeCreated.toString() : "Returned null value");
return typeCreated;
} catch (JCException e) {
JCOReflector.writeLog(e);
return null;
}
}
void addReference(String ref) throws Throwable {
try {
bridge.AddReference(ref);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
/**
* Internal constructor. Use with caution
*/
public Rune(java.lang.Object instance) throws Throwable {
super(instance);
if (instance instanceof JCObject) {
classInstance = (JCObject) instance;
} else
throw new Exception("Cannot manage object, it is not a JCObject");
}
public String getJCOAssemblyName() {
return assemblyFullName;
}
public String getJCOClassName() {
return className;
}
public String getJCOObjectName() {
return className + ", " + (JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
}
public java.lang.Object getJCOInstance() {
return classInstance;
}
public void setJCOInstance(JCObject instance) {
classInstance = instance;
super.setJCOInstance(classInstance);
}
public JCType getJCOType() {
return classType;
}
/**
* Try to cast the {@link IJCOBridgeReflected} instance into {@link Rune}, a cast assert is made to check if types are compatible.
* @param from {@link IJCOBridgeReflected} instance to be casted
* @return {@link Rune} instance
* @throws java.lang.Throwable in case of error during cast operation
*/
public static Rune cast(IJCOBridgeReflected from) throws Throwable {
NetType.AssertCast(classType, from);
return new Rune(from.getJCOInstance());
}
// Constructors section
public Rune() throws Throwable {
}
public Rune(char highSurrogate, char lowSurrogate) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.ObjectDisposedException, system.RankException {
try {
// add reference to assemblyName.dll file
addReference(JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
setJCOInstance((JCObject)classType.NewObject(highSurrogate, lowSurrogate));
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public Rune(char ch) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.ObjectDisposedException, system.RankException {
try {
// add reference to assemblyName.dll file
addReference(JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
setJCOInstance((JCObject)classType.NewObject(ch));
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public Rune(int value) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.IndexOutOfRangeException, system.PlatformNotSupportedException, system.NotSupportedException, system.ArgumentNullException, system.ObjectDisposedException, system.InvalidOperationException, system.RankException, system.ArrayTypeMismatchException {
try {
// add reference to assemblyName.dll file
addReference(JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
setJCOInstance((JCObject)classType.NewObject(value));
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public Rune(UInt32 value) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.ObjectDisposedException, system.RankException {
try {
// add reference to assemblyName.dll file
addReference(JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
setJCOInstance((JCObject)classType.NewObject(value == null ? null : value.getJCOInstance()));
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
// Methods section
public boolean Equals(Rune other) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (boolean)classInstance.Invoke("Equals", other == null ? null : other.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static boolean IsControl(Rune value) throws Throwable {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
return (boolean)classType.Invoke("IsControl", value == null ? null : value.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static boolean IsDigit(Rune value) throws Throwable, system.ArgumentException, system.PlatformNotSupportedException, system.NotSupportedException, system.ArgumentNullException, system.InvalidOperationException, system.ArgumentOutOfRangeException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
return (boolean)classType.Invoke("IsDigit", value == null ? null : value.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static boolean IsLetter(Rune value) throws Throwable, system.ArgumentException, system.PlatformNotSupportedException, system.NotSupportedException, system.ArgumentNullException, system.InvalidOperationException, system.ArgumentOutOfRangeException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
return (boolean)classType.Invoke("IsLetter", value == null ? null : value.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static boolean IsLetterOrDigit(Rune value) throws Throwable, system.ArgumentException, system.PlatformNotSupportedException, system.NotSupportedException, system.ArgumentNullException, system.InvalidOperationException, system.ArgumentOutOfRangeException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
return (boolean)classType.Invoke("IsLetterOrDigit", value == null ? null : value.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static boolean IsLower(Rune value) throws Throwable, system.ArgumentException, system.PlatformNotSupportedException, system.NotSupportedException, system.ArgumentNullException, system.InvalidOperationException, system.ArgumentOutOfRangeException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
return (boolean)classType.Invoke("IsLower", value == null ? null : value.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static boolean IsNumber(Rune value) throws Throwable, system.ArgumentException, system.PlatformNotSupportedException, system.NotSupportedException, system.ArgumentNullException, system.InvalidOperationException, system.ArgumentOutOfRangeException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
return (boolean)classType.Invoke("IsNumber", value == null ? null : value.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static boolean IsPunctuation(Rune value) throws Throwable, system.NotSupportedException, system.ArgumentException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArgumentOutOfRangeException, system.FormatException, system.IndexOutOfRangeException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
return (boolean)classType.Invoke("IsPunctuation", value == null ? null : value.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static boolean IsSeparator(Rune value) throws Throwable, system.NotSupportedException, system.ArgumentException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArgumentOutOfRangeException, system.FormatException, system.IndexOutOfRangeException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
return (boolean)classType.Invoke("IsSeparator", value == null ? null : value.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static boolean IsSymbol(Rune value) throws Throwable, system.NotSupportedException, system.ArgumentException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArgumentOutOfRangeException, system.FormatException, system.IndexOutOfRangeException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
return (boolean)classType.Invoke("IsSymbol", value == null ? null : value.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static boolean IsUpper(Rune value) throws Throwable, system.ArgumentException, system.PlatformNotSupportedException, system.NotSupportedException, system.ArgumentNullException, system.InvalidOperationException, system.ArgumentOutOfRangeException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
return (boolean)classType.Invoke("IsUpper", value == null ? null : value.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static boolean IsValid(int value) throws Throwable {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
return (boolean)classType.Invoke("IsValid", value);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static boolean IsValid(UInt32 value) throws Throwable {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
return (boolean)classType.Invoke("IsValid", value == null ? null : value.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static boolean IsWhiteSpace(Rune value) throws Throwable, system.ArgumentException, system.PlatformNotSupportedException, system.NotSupportedException, system.ArgumentNullException, system.InvalidOperationException, system.ArgumentOutOfRangeException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
return (boolean)classType.Invoke("IsWhiteSpace", value == null ? null : value.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static boolean TryCreate(char highSurrogate, char lowSurrogate, JCORefOut result) throws Throwable {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
return (boolean)classType.Invoke("TryCreate", highSurrogate, lowSurrogate, result.getJCRefOut());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static boolean TryCreate(char ch, JCORefOut result) throws Throwable {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
return (boolean)classType.Invoke("TryCreate", ch, result.getJCRefOut());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static boolean TryCreate(int value, JCORefOut result) throws Throwable {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
return (boolean)classType.Invoke("TryCreate", value, result.getJCRefOut());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static boolean TryCreate(UInt32 value, JCORefOut result) throws Throwable {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
return (boolean)classType.Invoke("TryCreate", value == null ? null : value.getJCOInstance(), result.getJCRefOut());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static boolean TryGetRuneAt(java.lang.String input, int index, JCORefOut value) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.IndexOutOfRangeException, system.PlatformNotSupportedException, system.NotSupportedException, system.ArgumentNullException, system.ObjectDisposedException, system.InvalidOperationException, system.RankException, system.ArrayTypeMismatchException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
return (boolean)classType.Invoke("TryGetRuneAt", input, index, value.getJCRefOut());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static double GetNumericValue(Rune value) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.IndexOutOfRangeException, system.PlatformNotSupportedException, system.NotSupportedException, system.ArgumentNullException, system.ObjectDisposedException, system.InvalidOperationException, system.RankException, system.ArrayTypeMismatchException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
return (double)classType.Invoke("GetNumericValue", value == null ? null : value.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public int CompareTo(Rune other) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (int)classInstance.Invoke("CompareTo", other == null ? null : other.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static UnicodeCategory GetUnicodeCategory(Rune value) throws Throwable, system.ArgumentException, system.PlatformNotSupportedException, system.NotSupportedException, system.ArgumentNullException, system.InvalidOperationException, system.ArgumentOutOfRangeException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objGetUnicodeCategory = (JCObject)classType.Invoke("GetUnicodeCategory", value == null ? null : value.getJCOInstance());
return new UnicodeCategory(objGetUnicodeCategory);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static Rune GetRuneAt(java.lang.String input, int index) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.IndexOutOfRangeException, system.PlatformNotSupportedException, system.NotSupportedException, system.ArgumentNullException, system.ObjectDisposedException, system.InvalidOperationException, system.RankException, system.ArrayTypeMismatchException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objGetRuneAt = (JCObject)classType.Invoke("GetRuneAt", input, index);
return new Rune(objGetRuneAt);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static Rune ToLower(Rune value, CultureInfo culture) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.ArgumentNullException, system.ObjectDisposedException, system.RankException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objToLower = (JCObject)classType.Invoke("ToLower", value == null ? null : value.getJCOInstance(), culture == null ? null : culture.getJCOInstance());
return new Rune(objToLower);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static Rune ToLowerInvariant(Rune value) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.IndexOutOfRangeException, system.PlatformNotSupportedException, system.NotSupportedException, system.ArgumentNullException, system.ObjectDisposedException, system.InvalidOperationException, system.RankException, system.ArrayTypeMismatchException, system.globalization.CultureNotFoundException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objToLowerInvariant = (JCObject)classType.Invoke("ToLowerInvariant", value == null ? null : value.getJCOInstance());
return new Rune(objToLowerInvariant);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static Rune ToUpper(Rune value, CultureInfo culture) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.ArgumentNullException, system.ObjectDisposedException, system.RankException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objToUpper = (JCObject)classType.Invoke("ToUpper", value == null ? null : value.getJCOInstance(), culture == null ? null : culture.getJCOInstance());
return new Rune(objToUpper);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static Rune ToUpperInvariant(Rune value) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.IndexOutOfRangeException, system.PlatformNotSupportedException, system.NotSupportedException, system.ArgumentNullException, system.ObjectDisposedException, system.InvalidOperationException, system.RankException, system.ArrayTypeMismatchException, system.globalization.CultureNotFoundException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objToUpperInvariant = (JCObject)classType.Invoke("ToUpperInvariant", value == null ? null : value.getJCOInstance());
return new Rune(objToUpperInvariant);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
/**
* @deprecated Not for public use because the method is implemented in .NET with an explicit interface.
* Use the static ToIComparable method available in IComparable to obtain an object with an invocable method
*/
@Deprecated
public int CompareTo(NetObject obj) throws Throwable {
throw new UnsupportedOperationException("Not for public use because the method is implemented with an explicit interface. Use ToIComparable to obtain the full interface.");
}
/**
* @deprecated Not for public use because the method is implemented in .NET with an explicit interface.
* Use the static ToIFormattable method available in IFormattable to obtain an object with an invocable method
*/
@Deprecated
public java.lang.String ToString(java.lang.String format, IFormatProvider formatProvider) throws Throwable {
throw new UnsupportedOperationException("Not for public use because the method is implemented with an explicit interface. Use ToIFormattable to obtain the full interface.");
}
// Properties section
public boolean getIsAscii() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (boolean)classInstance.Get("IsAscii");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public boolean getIsBmp() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (boolean)classInstance.Get("IsBmp");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public int getPlane() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (int)classInstance.Get("Plane");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public int getUtf16SequenceLength() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (int)classInstance.Get("Utf16SequenceLength");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public int getUtf8SequenceLength() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (int)classInstance.Get("Utf8SequenceLength");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public int getValue() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (int)classInstance.Get("Value");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static Rune getReplacementChar() throws Throwable {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject val = (JCObject)classType.Get("ReplacementChar");
return new Rune(val);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
// Instance Events section
}