// javastubs/Test1/U_card.java
// Stubs for "Test1"
//
// This file was automatically generated with ILU (version 2.0beta1) tools
// at Tue Sep 21 11:45:19 1999 by `nobody'
// running "c:/iluwin/bin/java-stubber.exe" of Tue Sep 21 10:50:42 1999
// on "C:/iluwin/examples/test1/Test1.isl" of Mon Sep 20 15:53:47 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 U_card implements java.io.Serializable {
    boolean _init = false;
    int _dis = 0;
    java.lang.Object _val = null;

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

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

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

    public static U_card alloc_R(int _dis, TheR _v)
            throws org.omg.CORBA.BAD_OPERATION {
        U_card _res = new U_card();
        _res.set_R(_dis, _v);
        return _res;
    } //alloc_R

    public static U_card alloc_R(TheR _v)
            throws org.omg.CORBA.BAD_OPERATION {
        return alloc_R(0, _v);
    } //alloc_R

    public TheR get_R()
            throws org.omg.CORBA.BAD_OPERATION {
        if (!_init) {_throw();}
        switch(_dis) {
            case 0:
                break;
            default: 
                _throw();
        }
        return (TheR) ((TheR)_val);
    } //get_R

    public void set_R(int _d, TheR _v)
            throws org.omg.CORBA.BAD_OPERATION {
        switch (_d) {
            case 0:
                break;
            default: _throw();
        }
        _dis = _d;
        _val = _v;
        _init = true;
    } //set_R

    public void set_R(TheR _v) {
        set_R(0, _v);
    } //set_R

    public static U_card alloc_O2(int _dis, O2 _v)
            throws org.omg.CORBA.BAD_OPERATION {
        U_card _res = new U_card();
        _res.set_O2(_dis, _v);
        return _res;
    } //alloc_O2

    public static U_card alloc_O2(O2 _v)
            throws org.omg.CORBA.BAD_OPERATION {
        return alloc_O2(1, _v);
    } //alloc_O2

    public O2 get_O2()
            throws org.omg.CORBA.BAD_OPERATION {
        if (!_init) {_throw();}
        switch(_dis) {
            case 1:
                break;
            default: 
                _throw();
        }
        return (O2) ((O2)_val);
    } //get_O2

    public void set_O2(int _d, O2 _v)
            throws org.omg.CORBA.BAD_OPERATION {
        switch (_d) {
            case 1:
                break;
            default: _throw();
        }
        _dis = _d;
        _val = _v;
        _init = true;
    } //set_O2

    public void set_O2(O2 _v) {
        set_O2(1, _v);
    } //set_O2

} //U_card
