// Decompiled by Jad v1.5.7f. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) braces deadcode fieldsfirst 
// Source File Name:   CharacterConverter.java
// Class Version:      45.3

package oracle.sql.converter;

import java.io.Serializable;
import java.sql.SQLException;
import java.util.Vector;
import oracle.sql.ConverterArchive;

// flag ACC_SUPER is set
public abstract class CharacterConverter
    implements Serializable
{
    // Constants:          137
    // Interfaces:         1
    // Fields:             18
    // Methods:            15
    // Class Attributes:   1


    static final String CONVERTERNAMEPREFIX = "converter_xcharset/CharacterConverter";
    static final String CONVERTERIDPREFIX = "0000";
    static final String EX_MAP_ORACLE_TO_UCS = "Cannot map Oracle character to Unicode.";
    static final String EX_MAP_UCS_TO_ORACLE = "Cannot map Unicode to Oracle character.";
    static final int STORE_INCREMENT = 10;
    public static final int CHARCONV1BYTEID = 0;
    public static final int CHARCONV12BYTEID = 1;
    public static final int CHARCONVJAEUCID = 2;
    public static final int CHARCONVLCFIXEDID = 3;
    public static final int CHARCONVSJISID = 4;
    public static final int CHARCONVZHTEUCID = 5;
    public static final int CHARCONV2BYTEFIXEDID = 6;
    public static final int CHARCONVSHIFTID = 7;
    public static final int CHARCONVLCID = 8;
    public static final int CHARCONVGB18030ID = 9;
    static CharacterConverter m_converterStore[];
    public int m_groupId;
    public int m_oracleId;

    // Decompiling method: <init>  Signature: ()V
    // Max stack: 1, #locals: 1, #params: 1
    // Code length: 5 bytes, Code offset: 2226
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/converter/CharacterConverter; At 0 5 Range 0 4 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type V At 0 5 Range 0 4 Init 0 fixed
    public CharacterConverter()
    {
        super();
        return;
    }

    // Parameter  0 added: Name this Type Loracle/sql/converter/CharacterConverter; At 0 0 Range 0 4294967295 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type V At 0 0 Range 0 4294967295 Init 0 fixed
    public abstract void buildUnicodeToOracleMapping();

    // Parameter  0 added: Name this Type Loracle/sql/converter/CharacterConverter; At 0 0 Range 0 4294967295 Init 0 fixed
    // Parameter  1 added: Name vector Type Ljava/util/Vector; At 0 0 Range 0 4294967295 Init 0
    // RetValue   2 added: Name <returnValue> Type V At 0 0 Range 0 4294967295 Init 0 fixed
    public abstract void extractCodepoints(Vector vector);

    // Parameter  0 added: Name this Type Loracle/sql/converter/CharacterConverter; At 0 0 Range 0 4294967295 Init 0 fixed
    // Parameter  1 added: Name vector Type Ljava/util/Vector; At 0 0 Range 0 4294967295 Init 0
    // RetValue   2 added: Name <returnValue> Type V At 0 0 Range 0 4294967295 Init 0 fixed
    public abstract void extractExtraMappings(Vector vector);

    // Decompiling method: getGroupId  Signature: ()I
    // Max stack: 1, #locals: 1, #params: 1
    // Code length: 5 bytes, Code offset: 2293
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/converter/CharacterConverter; At 0 5 Range 0 4 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type I At 0 5 Range 0 4 Init 0 fixed
    public int getGroupId()
    {
        return m_groupId;
    }

    // Decompiling method: getInstance  Signature: (I)Loracle/sql/converter/CharacterConverter;
    // Max stack: 5, #locals: 10, #params: 1
    // Code length: 185 bytes, Code offset: 2336
    // Line Number Table found: 28 entries
    // Parameter  0 added: Name i Type I At 0 185 Range 0 184 Init 0
    // RetValue  10 added: Name <returnValue> Type Loracle/sql/converter/CharacterConverter; At 0 185 Range 0 184 Init 0 fixed
    // LocalVar   1 added: Name obj Type A At 1 1 Range 1 1 Init 1
    // LocalVar   2 added: Name flag Type Z At 3 178 Range 3 180 Init 3
    // LocalVar   3 added: Name flag1 Type Z At 5 164 Range 5 168 Init 5
    // LocalVar   3 chged: Name j Oname flag1 Type I At 16 153 Range 5 168 Init 5
    // LocalVar   2 chged: Name k Oname flag Type I At 45 1 Range 3 180 Init 3
    // LocalVar   4 added: Name s Type Ljava/lang/String; At 54 29 Range 54 82 Init 54
    // LocalVar   5 added: Name s1 Type Ljava/lang/String; At 89 19 Range 89 107 Init 89
    // LocalVar   7 added: Name converterarchive Type Loracle/sql/ConverterArchive; At 98 4 Range 98 101 Init 98
    // LocalVar   1 added: Name characterconverter Type Loracle/sql/converter/CharacterConverter; At 128 56 Range 128 183 Init 128
    // LocalVar   8 added: Name l Type I At 148 4 Range 148 151 Init 148
    // LocalVar   9 added: Name acharacterconverter Type [Loracle/sql/converter/CharacterConverter; At 155 19 Range 155 173 Init 155
    // LocalVar   1 added: Name characterconverter1 Type Loracle/sql/converter/CharacterConverter; At 28 13 Range 28 40 Init 28
    // LocalVar   6 hasn't been used
    // LocalVar   1 chged: Name characterconverter2 Oname obj Type Loracle/sql/converter/CharacterConverter; At 1 1 Range 1 1 Init 1
    // LocalVar   1 name characterconverter(Loracle/sql/converter/CharacterConverter;) merged out into characterconverter2(Loracle/sql/converter/CharacterConverter;)
    // LocalVar   1 name characterconverter1(Loracle/sql/converter/CharacterConverter;) merged out into characterconverter2(Loracle/sql/converter/CharacterConverter;)
    public static final CharacterConverter getInstance(int i)
    {
        CharacterConverter characterconverter = null;
        int j = 0;
        int k = 0;
        if(m_converterStore != null)
        {
            k = m_converterStore.length;
            for(j = 0; j < k; j++)
            {
                if((characterconverter = m_converterStore[j]) == null)
                {
                    break;
                }
                if(characterconverter.getOracleId() == i)
                {
                    return characterconverter;
                }
            }

        }
        String s = Integer.toHexString(i);
        String s1 = "converter_xcharset/CharacterConverter" + "0000".substring(0, 4 - s.length()) + s;
        ConverterArchive converterarchive = new ConverterArchive();
        characterconverter = (CharacterConverter)converterarchive.readObj(s1 + ".glb");
        if(characterconverter == null)
        {
            return null;
        }
        characterconverter.buildUnicodeToOracleMapping();
        if(j == k)
        {
            int l = k + 10;
            CharacterConverter acharacterconverter[] = new CharacterConverter[l];
            if(k > 0)
            {
                System.arraycopy(m_converterStore, 0, acharacterconverter, 0, k);
            }
            m_converterStore = acharacterconverter;
        }
        m_converterStore[j] = characterconverter;
        return characterconverter;
    }

    // Parameter  0 added: Name this Type Loracle/sql/converter/CharacterConverter; At 0 0 Range 0 4294967295 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type C At 0 0 Range 0 4294967295 Init 0 fixed
    public abstract char getOraChar1ByteRep();

    // Parameter  0 added: Name this Type Loracle/sql/converter/CharacterConverter; At 0 0 Range 0 4294967295 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type C At 0 0 Range 0 4294967295 Init 0 fixed
    public abstract char getOraChar2ByteRep();

    // Decompiling method: getOracleId  Signature: ()I
    // Max stack: 1, #locals: 1, #params: 1
    // Code length: 5 bytes, Code offset: 2683
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/converter/CharacterConverter; At 0 5 Range 0 4 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type I At 0 5 Range 0 4 Init 0 fixed
    public int getOracleId()
    {
        return m_oracleId;
    }

    // Parameter  0 added: Name this Type Loracle/sql/converter/CharacterConverter; At 0 0 Range 0 4294967295 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type C At 0 0 Range 0 4294967295 Init 0 fixed
    public abstract char getUCS2CharRep();

    // Parameter  0 added: Name this Type Loracle/sql/converter/CharacterConverter; At 0 0 Range 0 4294967295 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type Z At 0 0 Range 0 4294967295 Init 0 fixed
    public abstract boolean hasExtraMappings();

    // Parameter  0 added: Name this Type Loracle/sql/converter/CharacterConverter; At 0 0 Range 0 4294967295 Init 0 fixed
    // Parameter  1 added: Name s Type Ljava/lang/String; At 0 0 Range 0 4294967295 Init 0
    // RetValue   2 added: Name <returnValue> Type [B At 0 0 Range 0 4294967295 Init 0 fixed
    public abstract byte[] toOracleString(String s)
        throws SQLException;

    // Parameter  0 added: Name this Type Loracle/sql/converter/CharacterConverter; At 0 0 Range 0 4294967295 Init 0 fixed
    // Parameter  1 added: Name s Type Ljava/lang/String; At 0 0 Range 0 4294967295 Init 0
    // RetValue   2 added: Name <returnValue> Type [B At 0 0 Range 0 4294967295 Init 0 fixed
    public abstract byte[] toOracleStringWithReplacement(String s);

    // Parameter  0 added: Name this Type Loracle/sql/converter/CharacterConverter; At 0 0 Range 0 4294967295 Init 0 fixed
    // Parameter  1 added: Name abyte0 Type [B At 0 0 Range 0 4294967295 Init 0
    // Parameter  2 added: Name i Type I At 0 0 Range 0 4294967295 Init 0
    // Parameter  3 added: Name j Type I At 0 0 Range 0 4294967295 Init 0
    // RetValue   4 added: Name <returnValue> Type Ljava/lang/String; At 0 0 Range 0 4294967295 Init 0 fixed
    public abstract String toUnicodeString(byte abyte0[], int i, int j)
        throws SQLException;

    // Parameter  0 added: Name this Type Loracle/sql/converter/CharacterConverter; At 0 0 Range 0 4294967295 Init 0 fixed
    // Parameter  1 added: Name abyte0 Type [B At 0 0 Range 0 4294967295 Init 0
    // Parameter  2 added: Name i Type I At 0 0 Range 0 4294967295 Init 0
    // Parameter  3 added: Name j Type I At 0 0 Range 0 4294967295 Init 0
    // RetValue   4 added: Name <returnValue> Type Ljava/lang/String; At 0 0 Range 0 4294967295 Init 0 fixed
    public abstract String toUnicodeStringWithReplacement(byte abyte0[], int i, int j);
}
