// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package ilog.views.util.lang;

import ilog.views.util.swing.IlvSwingUtil;

public class IlvLangUtil
{

    protected IlvLangUtil()
    {
    }

    public static int charCount(int i)
    {
        return e.a(i);
    }

    int a(int i)
    {
        return i < 0x10000 ? 1 : 2;
    }

    public static int codePointAt(String s, int i)
    {
        return e.a(s, i);
    }

    int a(String s, int i)
    {
        if(i < 0 || i >= s.length())
            throw new StringIndexOutOfBoundsException(i);
        char c1 = s.charAt(i++);
        if(isHighSurrogate(c1) && i < s.length())
        {
            char c2 = s.charAt(i);
            if(isLowSurrogate(c2))
                return toCodePoint(c1, c2);
        }
        return c1;
    }

    public static boolean isHighSurrogate(char c1)
    {
        return c1 >= '\uD800' && c1 <= '\uDBFF';
    }

    public static boolean isLowSurrogate(char c1)
    {
        return c1 >= '\uDC00' && c1 <= '\uDFFF';
    }

    public static int toCodePoint(char c1, char c2)
    {
        return e.a(c1, c2);
    }

    int a(char c1, char c2)
    {
        return (c1 - 55296 << 10) + (c2 - 56320) + 0x10000;
    }

    public static int codePointBefore(String s, int i)
    {
        return e.b(s, i);
    }

    int b(String s, int i)
    {
        int j = i - 1;
        if(j < 0 || j >= s.length())
            throw new StringIndexOutOfBoundsException(i);
        char c1 = s.charAt(--i);
        if(isLowSurrogate(c1) && i > 0)
        {
            char c2 = s.charAt(--i);
            if(isHighSurrogate(c2))
                return toCodePoint(c2, c1);
        }
        return c1;
    }

    public static boolean isLowerCase(int i)
    {
        return e.b(i);
    }

    boolean b(int i)
    {
        if(i < 0x10000)
            return Character.isLowerCase((char)i);
        else
            return false;
    }

    public static boolean isUpperCase(int i)
    {
        return e.c(i);
    }

    boolean c(int i)
    {
        if(i < 0x10000)
            return Character.isUpperCase((char)i);
        else
            return false;
    }

    public static boolean isDigit(int i)
    {
        return e.d(i);
    }

    boolean d(int i)
    {
        if(i < 0x10000)
            return Character.isDigit((char)i);
        else
            return false;
    }

    public static boolean isLetter(int i)
    {
        return e.e(i);
    }

    boolean e(int i)
    {
        if(i < 0x10000)
            return Character.isLetter((char)i);
        else
            return false;
    }

    public static boolean isSpaceChar(int i)
    {
        return e.f(i);
    }

    boolean f(int i)
    {
        if(i < 0x10000)
            return Character.isSpaceChar((char)i);
        else
            return false;
    }

    public static boolean isWhitespace(int i)
    {
        return e.g(i);
    }

    boolean g(int i)
    {
        if(i < 0x10000)
            return Character.isWhitespace((char)i);
        else
            return false;
    }

    public static boolean isLetterOrDigit(int i)
    {
        return e.h(i);
    }

    boolean h(int i)
    {
        if(i < 0x10000)
            return Character.isLetterOrDigit((char)i);
        else
            return false;
    }

    private static final char a = 55296;
    private static final char b = 56319;
    private static final char c = 56320;
    private static final char d = 57343;
    public static final int MIN_SUPPLEMENTARY_CODE_POINT = 0x10000;
    private static IlvLangUtil e;

    static 
    {
        if(IlvSwingUtil.getSwingVersion().compareTo(new Version(1, 5, 0)) >= 0)
            try
            {
                e = (IlvLangUtil)Class.forName("ilog.views.util.lang.IlvLangUtil15").newInstance();
            }
            catch(Throwable throwable) { }
        if(e == null)
            e = new IlvLangUtil();
    }
}
