// javastubs/Test1/U_scard.java
// Stubs for "Test1"
//
// This file was automatically generated with ILU (version 2.0beta1) tools
// at Tue Sep 21 11:47:01 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 U_scard implements java.io.Serializable {
    boolean _init = false;
    short _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_scard() {
        _init = false;
        _val = null;
    } //constructor

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

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

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

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

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

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

    public static U_scard alloc_O5(short _dis, O5 _v)
            throws org.omg.CORBA.BAD_OPERATION {
        U_scard _res = new U_scard();
        _res.set_O5(_dis, _v);
        return _res;
    } //alloc_O5

    public static U_scard alloc_O5(O5 _v)
            throws org.omg.CORBA.BAD_OPERATION {
        return alloc_O5((short)1, _v);
    } //alloc_O5

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

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

    public void set_O5(O5 _v) {
        set_O5((short)1, _v);
    } //set_O5

} //U_scard
