Package erjang

Examples of erjang.EObject


      throw ERT.badarg(tab,key,upd);
    }
   
    ETableSet ets = (ETableSet) table;
   
    EObject res = ets.update_counter(key, upd);
   
    if (res == null) {
      throw ERT.badarg(tab,key,upd);     
    }
   
View Full Code Here


      s_upd = ERT.NIL.cons(t_upd);
    }
   
    ETableSet ets = (ETableSet) table;
   
    EObject res = ets.update_element(key, s_upd);
   
    if (res == null) {
      throw ERT.badarg(tab,key,upd);     
    }
   
View Full Code Here

    } else {
     
      for (ISeq<IMapEntry<EObject,Object>> seq = map.seq();seq != null;seq = seq.next()) {
        IMapEntry<EObject,Object> ent = (IMapEntry<EObject,Object>) seq.first();
        if (ent == null) return Native.am_$end_of_table;
        EObject key = (EObject) ent.getKey();
        if (key.equalsExactly(from)) {
          seq = seq.next();
          if (seq == null) return Native.am_$end_of_table;
          ent = (IMapEntry<EObject,Object>) seq.first();
          if (ent == null) return Native.am_$end_of_table;
          return (EObject) ent.getKey();
View Full Code Here

   
    ETuple2 tup2 = ETuple2.cast(head);
    if (tup2 != null) {
     
      if (tup2.elem1 == Native.am_protection) {
        EObject mode = tup2.elem2;
        if (mode == Native.am_private
            || mode == Native.am_public
            || mode == Native.am_protected) {
          this.access = (EAtom) mode;
          return;
View Full Code Here

  }

  @Override
  int http_error(TCPINet desc, byte[] data, int pos, int len) throws Pausable {

    EObject line = load_string(desc, data, pos, len);

    ETuple2 req = new ETuple2(am_http_error, line);
   
    if (desc.active == ActiveType.PASSIVE) {
          /* {inet_async, S, Ref, {error,{http_error,Line}}} */
 
View Full Code Here

  @Override
  int http_header(TCPINet desc, HTTPAtom name, byte[] nameBuf, int namePtr,
      int nameLen, byte[] valBuf, int valPtr, int valLen) throws Pausable {

    EObject bit = (name == null)
          ? ERT.box(0)
          : ERT.box( name.index + 1 );
    EObject nam = (name == null)
          ? load_string(desc, nameBuf, namePtr, nameLen)
          : name.atom;
   
    EObject value = load_string(desc, valBuf, valPtr, valLen);
         
         
    ETuple req = ETuple.make(am_http_header, bit, nam, ERT.am_undefined, value);

    return send_http(desc, req);
View Full Code Here

  @Override
  int http_request(TCPINet desc, HTTPAtom method, byte[] data, int meth_ptr,
      int meth_len, PacketHttpURI uri, int major, int minor) throws Pausable {
   
    EObject meth =
        (method == null)
        ? load_string(desc, data, meth_ptr, meth_len)
        : method.atom;
   
    ETuple version = new ETuple2(ERT.box(major), ERT.box(minor));
View Full Code Here

  public static EObject binary_to_term(EObject arg) {
    EBinary bin;
    if ((bin=arg.testBinary()) == null) throw ERT.badarg(arg);
    EInputStream in = bin.getInputStream();
    try {
      EObject val = in.read_any();
      //System.out.println("DECODED:"+val);
      return val;
    } catch (IOException e) {
      throw new ErlangError(ERT.am_badarg, e, arg);
    }
View Full Code Here

      if (options.head() == am_safe) {
        in.setSafe(true);
      }
    }
    try {
      EObject val = in.read_any();
      return val;
    } catch (ErlangError e) {
      throw new ErlangError(ERT.am_badarg, e, arg);
    } catch (IOException e) {
      throw new ErlangError(ERT.am_badarg, e, arg);
View Full Code Here

      throw ERT.badarg(obj, spec);
    }
   
    while (!opts.isNil()) {
     
      EObject val = opts.head();
      ETuple2 tup;
      if (val == am_compressed) {
        compression = 6;
      } else if ((tup=ETuple2.cast(val)) != null) {
        if (tup.elem1 == am_compressed) {
View Full Code Here

TOP

Related Classes of erjang.EObject

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.