// javastubs/Test1/U3.java
// Stubs for "Test1"
//
// This file was automatically generated with ILU (version 2.0beta1) tools
// at Tue Sep 21 11:47:02 1999 by `nobody'
// running "c:/iluwin/bin/java-stubber.exe" of Tue Sep 21 10:50:42 1999
// on "C:/iluwin/examples/pickle/Test1.isl" of Mon Sep 20 15:54:01 1999,
// and "c:/iluwin/interfaces/ilu.isl" of Mon Sep 20 15:51:47 1999.
//
// ILU is Copyright 1991-1999 Xerox Corporation, All Rights Reserved.
// ILU information:  ftp://ftp.parc.xerox.com/pub/ilu/ilu.html.



package Test1;


/** 
 * Class representing an ILU union type.
 */
public class U3 implements java.io.Serializable {
    boolean _init = false;
    TheE _dis = null;
    java.lang.Object _val = null;

    static void _throw()
            throws org.omg.CORBA.BAD_OPERATION {
        throw new org.omg.CORBA.BAD_OPERATION();
    } //_throw

    public U3() {
        _init = false;
        _val = null;
    } //constructor

    public TheE discriminator()
                throws org.omg.CORBA.BAD_OPERATION {
        if (!_init) {
            _throw();
        }
        return _dis;
    } //discriminator

    public static U3 alloc_xerox_ilu_CString(TheE _dis, java.lang.String _v)
            throws org.omg.CORBA.BAD_OPERATION {
        U3 _res = new U3();
        _res.set_xerox_ilu_CString(_dis, _v);
        return _res;
    } //alloc_xerox_ilu_CString

    public static U3 alloc_xerox_ilu_CString(java.lang.String _v)
            throws org.omg.CORBA.BAD_OPERATION {
        return alloc_xerox_ilu_CString(TheE.ev1, _v);
    } //alloc_xerox_ilu_CString

    public java.lang.String get_xerox_ilu_CString()
            throws org.omg.CORBA.BAD_OPERATION {
        if (!_init) {_throw();}
        switch(_dis.value()) {
            case TheE._ev1:
                break;
            default: 
                _throw();
        }
        return (java.lang.String) ((java.lang.String)_val);
    } //get_xerox_ilu_CString

    public void set_xerox_ilu_CString(TheE _d, java.lang.String _v)
            throws org.omg.CORBA.BAD_OPERATION {
        switch (_d.value()) {
            case TheE._ev1:
                break;
            default: _throw();
        }
        _dis = _d;
        _val = _v;
        _init = true;
    } //set_xerox_ilu_CString

    public void set_xerox_ilu_CString(java.lang.String _v) {
        set_xerox_ilu_CString(TheE.ev1, _v);
    } //set_xerox_ilu_CString

    public static U3 alloc_U2(TheE _dis, U2 _v)
            throws org.omg.CORBA.BAD_OPERATION {
        U3 _res = new U3();
        _res.set_U2(_dis, _v);
        return _res;
    } //alloc_U2

    public static U3 alloc_U2(U2 _v)
            throws org.omg.CORBA.BAD_OPERATION {
        return alloc_U2(TheE.ev3, _v);
    } //alloc_U2

    public U2 get_U2()
            throws org.omg.CORBA.BAD_OPERATION {
        if (!_init) {_throw();}
        switch(_dis.value()) {
            case TheE._ev3:
                break;
            default: 
                _throw();
        }
        return (U2) ((U2)_val);
    } //get_U2

    public void set_U2(TheE _d, U2 _v)
            throws org.omg.CORBA.BAD_OPERATION {
        switch (_d.value()) {
            case TheE._ev3:
                break;
            default: _throw();
        }
        _dis = _d;
        _val = _v;
        _init = true;
    } //set_U2

    public void set_U2(U2 _v) {
        set_U2(TheE.ev3, _v);
    } //set_U2

    public static U3 alloc_v3(TheE _dis, O5 _v)
            throws org.omg.CORBA.BAD_OPERATION {
        U3 _res = new U3();
        _res.set_v3(_dis, _v);
        return _res;
    } //alloc_v3

    public static U3 alloc_v3(O5 _v)
            throws org.omg.CORBA.BAD_OPERATION {
        return alloc_v3(TheE.ev7, _v);
    } //alloc_v3

    public O5 get_v3()
            throws org.omg.CORBA.BAD_OPERATION {
        if (!_init) {_throw();}
        switch(_dis.value()) {
            case TheE._ev7:
                break;
            default: 
                _throw();
        }
        return (O5) ((O5)_val);
    } //get_v3

    public void set_v3(TheE _d, O5 _v)
            throws org.omg.CORBA.BAD_OPERATION {
        switch (_d.value()) {
            case TheE._ev7:
                break;
            default: _throw();
        }
        _dis = _d;
        _val = _v;
        _init = true;
    } //set_v3

    public void set_v3(O5 _v) {
        set_v3(TheE.ev7, _v);
    } //set_v3

    public static U3 alloc_v4(TheE _dis, TheR _v)
            throws org.omg.CORBA.BAD_OPERATION {
        U3 _res = new U3();
        _res.set_v4(_dis, _v);
        return _res;
    } //alloc_v4

    public TheR get_v4()
            throws org.omg.CORBA.BAD_OPERATION {
        if (!_init) {_throw();}
        switch(_dis.value()) {
            case TheE._ev1:
            case TheE._ev3:
            case TheE._ev7:
                _throw();
            default: break;
        }
        return (TheR) ((TheR)_val);
    } //get_v4

    public void set_v4(TheE _d, TheR _v)
            throws org.omg.CORBA.BAD_OPERATION {
        switch (_d.value()) {
            case TheE._ev1:
            case TheE._ev3:
            case TheE._ev7:
                _throw();
            default:
                break;
        }
        _dis = _d;
        _val = _v;
        _init = true;
    } //set_v4

} //U3
