package nsdb.LocationPackage;
public class LocationNode_uHelper
{
	private static org.omg.CORBA.TypeCode _type;
	public LocationNode_uHelper ()
	{
	}
	public static void insert(org.omg.CORBA.Any any, nsdb.LocationPackage.LocationNode_u s)
	{
		any.type(type());
		write( any.create_output_stream(),s);
	}
	public static nsdb.LocationPackage.LocationNode_u extract(org.omg.CORBA.Any any)
	{
		return read(any.create_input_stream());
	}
	public String get_id()
	{
		return id();
	}
	public org.omg.CORBA.TypeCode get_type()
	{
		return type();
	}
	public void write_Object(org.omg.CORBA.portable.OutputStream out, java.lang.Object obj)
	{
		 throw new RuntimeException(" not implemented");
	}
	public java.lang.Object read_Object(org.omg.CORBA.portable.InputStream in)
	{
		 throw new RuntimeException(" not implemented");
	}
	public static String id()
	{
		return "IDL:nsdb/Location/LocationNode_u:1.0";
	}
	public static LocationNode_u read(org.omg.CORBA.portable.InputStream in)
	{
		LocationNode_u result = new LocationNode_u();
		int disc=in.read_long();
		switch(disc)
		{
			case 4:
			{
				nsdb.LocationPackage.LocOperator _var;
				_var=nsdb.LocationPackage.LocOperatorHelper.read(in);
				result.operator(_var);
				break;
			}
			case 3:
			{
				type.Fuzzy _var;
				_var = nsdb.LocationPackage.LocGapHelper.read(in);
				result.gap(_var);
				break;
			}
			case 2:
			{
				java.lang.String _var;
				_var = nsdb.LocationPackage.LocPhysicalSegmentHelper.read(in);
				result.physical(_var);
				break;
			}
			case 1:
			{
				nsdb.LocationPackage.LocVirtualSegment _var;
				_var=nsdb.LocationPackage.LocVirtualSegmentHelper.read(in);
				result.virtual(_var);
				break;
			}
			default: result.__default();
		}
		return result;
	}
	public static void write(org.omg.CORBA.portable.OutputStream out, LocationNode_u s)
	{
		out.write_long(s.discriminator());;
		switch(s.discriminator())
		{
			case 4:
			{
				nsdb.LocationPackage.LocOperatorHelper.write(out,s.operator());
				break;
			}
			case 3:
			{
				nsdb.LocationPackage.LocGapHelper.write(out,s.gap());
				break;
			}
			case 2:
			{
				nsdb.LocationPackage.LocPhysicalSegmentHelper.write(out,s.physical());
				break;
			}
			case 1:
			{
				nsdb.LocationPackage.LocVirtualSegmentHelper.write(out,s.virtual());
				break;
			}
		}
	}
	public static org.omg.CORBA.TypeCode type()
	{
		if( _type == null )
		{
			org.omg.CORBA.UnionMember[] members = new org.omg.CORBA.UnionMember[4];
			org.omg.CORBA.Any label_any;
			label_any = org.omg.CORBA.ORB.init().create_any();
			members[0] = new org.omg.CORBA.UnionMember("operator",label_any,nsdb.LocationPackage.LocOperatorHelper.type(),null);
			label_any = org.omg.CORBA.ORB.init().create_any();
			members[1] = new org.omg.CORBA.UnionMember("gap",label_any,org.omg.CORBA.ORB.init().create_alias_tc( id(),"LocGap",org.omg.CORBA.ORB.init().create_struct_tc(id(),"Fuzzy",new org.omg.CORBA.StructMember[]{new org.omg.CORBA.StructMember("value",org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.from_int(3)),null),new org.omg.CORBA.StructMember("size",org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.from_int(3)),null),new org.omg.CORBA.StructMember("type",org.omg.CORBA.ORB.init().create_alias_tc( id(),"FuzzyTypeCode",org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.from_int(3))),null)})),null);
			label_any = org.omg.CORBA.ORB.init().create_any();
			members[2] = new org.omg.CORBA.UnionMember("physical",label_any,org.omg.CORBA.ORB.init().create_alias_tc( id(),"LocPhysicalSegment",org.omg.CORBA.ORB.init().create_string_tc(0)),null);
			label_any = org.omg.CORBA.ORB.init().create_any();
			members[3] = new org.omg.CORBA.UnionMember("virtual",label_any,nsdb.LocationPackage.LocVirtualSegmentHelper.type(),null);
			 _type = org.omg.CORBA.ORB.init().create_union_tc(id(),"LocationNode_u",org.omg.CORBA.ORB.init().create_alias_tc( id(),"LocNodeTypeCode",org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.from_int(3))), members);
		}
		return _type;
	}
}
