package nsdb.LocationPackage;


/**
* nsdb/LocationPackage/LocOperatorHelper.java .
* Generated by the IDL-to-Java compiler (portable), version "3.1"
* from corba/nsdb.idl
* Friday, March 2, 2007 1:07:21 PM GMT
*/


/**
       * Location operator. This is a node in the location tree that combines
       * nodes lower down in the tree
       * <dl>
       * <dt> op
       * <dd> operator defining what to do with the nodes
       * <dd> <dl>
       *      <dt> join
       *       <dd> The indicated elements should be joined (placed end-to-end)
       *            to form one contiguous sequence
       *      <dt> order
       *       <dd> The elements can be found in the specified order
       *            (5' to 3' direction), but nothing is implied about the
       *            reasonableness about joining them 
       *      </dl>
       * <dt> childIds
       * <dd> identifiers of the child nodes
       * <dd> Ids is an array of IDs relative to the current node
       *      e.g if the current node is at position x in the LocationNodes sequence
       *      and there is a childId with value j
       *      then the position of this child in the LocationNodes sequence will be x+j
       *</dl>
       */
abstract public class LocOperatorHelper
{
  private static String  _id = "IDL:nsdb/Location/LocOperator:1.0";

  public static void insert (org.omg.CORBA.Any a, nsdb.LocationPackage.LocOperator that)
  {
    org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
    a.type (type ());
    write (out, that);
    a.read_value (out.create_input_stream (), type ());
  }

  public static nsdb.LocationPackage.LocOperator extract (org.omg.CORBA.Any a)
  {
    return read (a.create_input_stream ());
  }

  private static org.omg.CORBA.TypeCode __typeCode = null;
  private static boolean __active = false;
  synchronized public static org.omg.CORBA.TypeCode type ()
  {
    if (__typeCode == null)
    {
      synchronized (org.omg.CORBA.TypeCode.class)
      {
        if (__typeCode == null)
        {
          if (__active)
          {
            return org.omg.CORBA.ORB.init().create_recursive_tc ( _id );
          }
          __active = true;
          org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [2];
          org.omg.CORBA.TypeCode _tcOf_members0 = null;
          _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0);
          _members0[0] = new org.omg.CORBA.StructMember (
            "op",
            _tcOf_members0,
            null);
          _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ulong);
          _tcOf_members0 = org.omg.CORBA.ORB.init ().create_sequence_tc (0, _tcOf_members0);
          _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (nsdb.LocationPackage.IdListHelper.id (), "IdList", _tcOf_members0);
          _members0[1] = new org.omg.CORBA.StructMember (
            "childIds",
            _tcOf_members0,
            null);
          __typeCode = org.omg.CORBA.ORB.init ().create_struct_tc (nsdb.LocationPackage.LocOperatorHelper.id (), "LocOperator", _members0);
          __active = false;
        }
      }
    }
    return __typeCode;
  }

  public static String id ()
  {
    return _id;
  }

  public static nsdb.LocationPackage.LocOperator read (org.omg.CORBA.portable.InputStream istream)
  {
    nsdb.LocationPackage.LocOperator value = new nsdb.LocationPackage.LocOperator ();
    value.op = istream.read_string ();
    value.childIds = nsdb.LocationPackage.IdListHelper.read (istream);
    return value;
  }

  public static void write (org.omg.CORBA.portable.OutputStream ostream, nsdb.LocationPackage.LocOperator value)
  {
    ostream.write_string (value.op);
    nsdb.LocationPackage.IdListHelper.write (ostream, value.childIds);
  }

}
