Example #1
0
  /**
   * Port value extractor method
   *
   * @return Port, the value of Term
   */
  public Port extract_Port() throws java.lang.Exception {

    if ((tcV == null) && (PortV != null)) return PortV;

    if (tcV.equal(PortHelper.type())) return PortV;

    throw new java.lang.Exception("");
  }
Example #2
0
 /** Port value insertion method */
 public void insert_Port(Port p) {
   PortV = p;
   tag = com.ericsson.otp.erlang.OtpExternal.portTag;
   tcV = PortHelper.type();
 }
Example #3
0
  /** Writes the value of Term to a stream */
  public void write_value(com.ericsson.otp.erlang.OtpOutputStream _os) throws java.lang.Exception {

    if ((tcV == null) && (ObjV != null)) _os.write_any(ObjV); // Type not generated by IC
    else {

      switch (tcV.kind().value()) {
        case TCKind._tk_octet:
        case TCKind._tk_char:
        case TCKind._tk_wchar:
        case TCKind._tk_short:
        case TCKind._tk_ushort:
        case TCKind._tk_long:
        case TCKind._tk_longlong:
        case TCKind._tk_ulong:
        case TCKind._tk_ulonglong:
          _os.write_long(longV);
          break;

        case TCKind._tk_float:
          _os.write_double(doubleV);
          break;

        case TCKind._tk_double:
          _os.write_double(doubleV);
          break;

        case TCKind._tk_boolean:
          _os.write_boolean(booleanV);
          break;

        case TCKind._tk_string:
        case TCKind._tk_wstring:
          _os.write_string(stringV);
          break;

        case TCKind._tk_atom:
          _os.write_atom(stringV);
          break;

        case TCKind._tk_struct:
          if (isPid()) PidHelper.marshal(_os, PidV);
          else {
            if (isReference()) RefHelper.marshal(_os, RefV);
            else {
              if (isPort()) PortHelper.marshal(_os, PortV);
              else _os.write(os.toByteArray());
            }
          }
          break;

        case TCKind._tk_union:
        case TCKind._tk_array:
        case TCKind._tk_sequence:
        case TCKind._tk_enum:
          _os.write(os.toByteArray());
          break;

        case TCKind._tk_void:
          _os.write_atom("ok");
          break;

          /*
           * Not supported types
           */
        default:
          throw new java.lang.Exception("BAD KIND");
      }
    }
  }