Package erjang

Examples of erjang.ETuple2


          } else if (value == FALSE_ATOM) {
            mv.visitInsn(ICONST_0);
            return Type.BOOLEAN_TYPE;
          }
          if (value instanceof ETuple2) {
            ETuple2 t2 = (ETuple2) value;
            if (t2.elm(1) == ATOM_field_flags) {
              push_int(t2.elem2.asInt());
              return Type.INT_TYPE;
            }
          }
          throw new Error("cannot convert " + value + " as "
View Full Code Here


    EAtom priority = null;
   
    for (; !o.isNil(); o = o.tail() ) {
      EObject val = o.head();
     
      ETuple2 t2;
      if (val == am_link) {
        link = true;
      } else if (val == am_monitor) {
        monitor = true;
      } else if ((t2 = ETuple2.cast(val)) != null) {
       
        if (t2.elm(1) == am_priority) {
          EAtom am = t2.elm(2).testAtom();
          if (am != null)
            priority = am;
        }
       
        // ignore full_sweep_after and min_heap_size
      }
     
    }
   

    EProc p2 = new EProc(self.group_leader(), m, f, a);
   
    if (link) {
      self.link_to(p2);
    }
   
    if (priority != null) {
      // may throw badarg!
      p2.process_flag(am_priority, priority);
    }
   
    ERef ref = null;
    if (monitor) {
      ref = ERT.getLocalNode().createRef();
     
      if (!self.monitor(p2.self_handle(), p2.self_handle(), ref)) {
        throw new InternalError("cannot monitor new process?");
        // self.mbox_send(ETuple.make(ERT.am_DOWN, ref, p2.self_handle(), ERT.am_noproc));
      }

    }
   
    ERT.run(p2);
   
    if (monitor) {
      return new ETuple2(p2.self_handle(), ref);
    } else {
      return p2.self_handle();
    }

  }
View Full Code Here

    EAtom name;
    if (h == null && (name=object.testAtom()) != null) {
      ERef ref = ERT.getLocalNode().createRef();
      boolean success = false;
     
      object = new ETuple2(name, ErlDist.node());
     
      if ((h = ERT.whereis(name).testHandle()) != null)
      {  
        success = self.monitor(h, object, ref);
     
View Full Code Here

    } else if (type == am_compat_rel) {
        // we return same value as R14
        return new ESmall(14);
    }
   
    ETuple2 tup;
    if (type == am_allocated_areas) {

      ECons res = ERT.NIL;

      List<MemoryPoolMXBean> bean2 = ManagementFactory
View Full Code Here

    return tail;
  }

  @Override
  public EObject head() {
    return new ETuple2(JavaObject.box(self, ent.getKey()),
               JavaObject.box(self, ent.getValue()));
  }
View Full Code Here

      if (ss.length() == s.length()) {
        rest = ERT.NIL;
      } else {
        rest = new EString(s.substring(ss.length()));
      }
      return new ETuple2(intval, rest);     
    } else {
      return new ETuple2(am_error, am_no_integer);
    }
  }
View Full Code Here

      if (ss.length() == s.length()) {
        rest = ERT.NIL;
      } else {
        rest = new EString(s.substring(ss.length()));
      }
      return new ETuple2(floatval, rest);     
    } else {
      return new ETuple2(am_error, am_no_float);
    }
  }
View Full Code Here

    static EAtom am_ok = EAtom.intern("ok");
    static EAtom am_loaded = EAtom.intern("loaded");

  @BIF public static
  ETuple2 loaded_drivers() {
    return new ETuple2(ERT.am_ok, Drivers.getLoaded());
  }
View Full Code Here

 
  @BIF public static
  EObject try_load(EObject path, EObject driver, EObject options) {

      if (log.isLoggable(Level.FINE)) log.fine("hack try_load: "+driver);
      return new ETuple2(am_ok, am_loaded);
  }
View Full Code Here

       */
      private Arg decode_arg(int insn_idx, EObject src) {
        TypeMap current = this.map[insn_idx];

        if (src instanceof ETuple2) {
          ETuple2 tup = (ETuple2) src;
          if (tup.elem1 == X_ATOM) {
            int xreg = tup.elem2.asInt();
            return new Arg(Arg.Kind.X, xreg, current.getx(xreg));
          } else if (tup.elem1 == Y_ATOM) {
            int yreg = tup.elem2.asInt();
View Full Code Here

TOP

Related Classes of erjang.ETuple2

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.