protected void setValue()

in yoko-core/src/main/java/org/apache/yoko/orb/DynamicAny/DynSeqBase_impl.java [254:356]


    protected void setValue(int index, org.omg.CORBA.Any any)
            throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
            org.omg.DynamicAny.DynAnyPackage.InvalidValue {
        //
        // Set the value of the primitive array and/or component from
        // the contents of the any
        //

        org.apache.yoko.orb.OB.Assert._OB_assert(index < length_);

        if (components_[index] != null)
            components_[index].from_any(any);
        else {
            switch (contentKind_.value()) {
            case org.omg.CORBA.TCKind._tk_short: {
                short[] buf = (short[]) buf_;
                buf[index] = any.extract_short();
                break;
            }

            case org.omg.CORBA.TCKind._tk_long: {
                int[] buf = (int[]) buf_;
                buf[index] = any.extract_long();
                break;
            }

            case org.omg.CORBA.TCKind._tk_ushort: {
                short[] buf = (short[]) buf_;
                buf[index] = any.extract_ushort();
                break;
            }

            case org.omg.CORBA.TCKind._tk_ulong: {
                int[] buf = (int[]) buf_;
                buf[index] = any.extract_ulong();
                break;
            }

            case org.omg.CORBA.TCKind._tk_float: {
                float[] buf = (float[]) buf_;
                buf[index] = any.extract_float();
                break;
            }

            case org.omg.CORBA.TCKind._tk_double: {
                double[] buf = (double[]) buf_;
                buf[index] = any.extract_double();
                break;
            }

            case org.omg.CORBA.TCKind._tk_boolean: {
                boolean[] buf = (boolean[]) buf_;
                buf[index] = any.extract_boolean();
                break;
            }

            case org.omg.CORBA.TCKind._tk_char: {
                char[] buf = (char[]) buf_;
                buf[index] = any.extract_char();
                break;
            }

            case org.omg.CORBA.TCKind._tk_octet: {
                byte[] buf = (byte[]) buf_;
                buf[index] = any.extract_octet();
                break;
            }

            case org.omg.CORBA.TCKind._tk_string: {
                String[] buf = (String[]) buf_;
                buf[index] = any.extract_string();
                break;
            }

            case org.omg.CORBA.TCKind._tk_longlong: {
                long[] buf = (long[]) buf_;
                buf[index] = any.extract_longlong();
                break;
            }

            case org.omg.CORBA.TCKind._tk_ulonglong: {
                long[] buf = (long[]) buf_;
                buf[index] = any.extract_ulonglong();
                break;
            }

            case org.omg.CORBA.TCKind._tk_wchar: {
                char[] buf = (char[]) buf_;
                buf[index] = any.extract_wchar();
                break;
            }

            case org.omg.CORBA.TCKind._tk_wstring: {
                String[] buf = (String[]) buf_;
                buf[index] = any.extract_wstring();
                break;
            }

            default:
                org.apache.yoko.orb.OB.Assert._OB_assert("Unsupported sequence type");
            }
        }
    }