// javastubs/Test1/U_byte.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 U_byte implements java.io.Serializable {
    boolean _init = false;
    byte _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_byte() {
        _init = false;
        _val = null;
    } //constructor

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

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

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

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

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

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

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

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

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

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

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

} //U_byte
