java.lang.Character.isValidCodePoint C# (CSharp) Méthode

isValidCodePoint() private méthode

private isValidCodePoint ( int par0 ) : bool
par0 int
Résultat bool
        public static bool isValidCodePoint(int par0)
        {
            global::net.sf.jni4net.jni.JNIEnv @__env = global::net.sf.jni4net.jni.JNIEnv.ThreadEnv;
            using(new global::net.sf.jni4net.jni.LocalFrame(@__env, 12)){
            return ((bool)(@__env.CallStaticBooleanMethod(global::java.lang.Character.staticClass, global::java.lang.Character.j4n_isValidCodePoint29, global::net.sf.jni4net.utils.Convertor.ParPrimC2J(par0))));
            }
        }

Usage Example

Exemple #1
0
        public String(int[] codePoints, int offset, int count)
        {
            if (offset < 0)
            {
                throw new IndexOutOfRangeException();
            }
            if (count < 0)
            {
                throw new IndexOutOfRangeException();
            }
            // Note: offset or count might be near -1>>>1.
            if (offset > codePoints.Length - count)
            {
                throw new IndexOutOfRangeException();
            }

            int end = offset + count;

            // Pass 1: Compute precise size of char[]
            int n = count;

            for (int i = offset; i < end; i++)
            {
                int c = codePoints[i];
                if (Character.isBmpCodePoint(c))
                {
                    continue;
                }
                else if (Character.isValidCodePoint(c))
                {
                    n++;
                }
                else
                {
                    throw new IllegalArgumentException();
                }
            }

            // Pass 2: Allocate and fill in char[]
            char[] v = new char[n];

            for (int i = offset, j = 0; i < end; i++, j++)
            {
                int c = codePoints[i];
                if (Character.isBmpCodePoint(c))
                {
                    v[j] = (char)c;
                }
                else
                {
                    Character.toSurrogates(c, v, j++);
                }
            }

            this.value = v;
        }
All Usage Examples Of java.lang.Character::isValidCodePoint