// javastubs/Test1/OO2.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 OO2 implements java.io.Serializable {
    boolean _init = false;
    boolean _dis = false;
    java.lang.Object _val = null;

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

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

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

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

    public static OO2 alloc_O5(O5 _v)
            throws org.omg.CORBA.BAD_OPERATION {
        return alloc_O5(true, _v);
    } //alloc_O5

    public O5 get_O5()
            throws org.omg.CORBA.BAD_OPERATION {
        if (!_init) {_throw();}
        if(_dis) _throw();
        return (O5) ((O5)_val);
    } //get_O5

    public void set_O5(boolean _d, O5 _v)
            throws org.omg.CORBA.BAD_OPERATION {
        if(!_d) _throw();
        _dis = _d;
        _val = _v;
        _init = true;
    } //set_O5

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

    public void setOther(boolean _d)
            throws org.omg.CORBA.BAD_OPERATION {
        if(_d) _throw();
        _dis = _d;
        _val = null;
        _init = true;
    } //setOther

    public static OO2 allocOther(boolean _dis)
            throws org.omg.CORBA.BAD_OPERATION {
        OO2 _res = new OO2();
        _res.setOther(_dis);
        return _res;
    } //allocOther

} //OO2
