Package erjang

Examples of erjang.EString.stringValue()


        exitCode = val.value;
      }
     
      EString str = value.testString();
      if (str != null) {
        message = str.stringValue();
      }
    }
   
    /*
    // TODO: create crash file
View Full Code Here


          return EString.make(bin).stringValue();
        }
       
        EString str;
        if ((str = io_or_char_list.testString()) != null) {
          return str.stringValue();
        }
       
        List<ByteBuffer> bb = new ArrayList<ByteBuffer>();
        if (io_or_char_list.collectIOList(bb)) {
          StringWriter sw = new StringWriter();
View Full Code Here

  public static ETuple2 to_integer(EObject val)
  {
    EString v = val.testString();
    if (v == null) throw ERT.badarg(val);
   
    String s = v.stringValue();
    Matcher m = int_pattern.matcher(s);
    if (m.matches()) {
      String ss = m.group(1);
      EInteger intval = ERT.box_parse(ss);
      ESeq rest;
View Full Code Here

  public static ETuple2 to_float(EObject val)
  {
    EString v = val.testString();
    if (v == null) throw ERT.badarg(val);
   
    String s = v.stringValue();
    Matcher m = float_pattern.matcher(s);
    if (m.matches()) {
      String ss = m.group(1);
      EDouble floatval = ERT.box( Double.parseDouble(ss) );
      ESeq rest;
View Full Code Here

              Integer groupNo = o2.named_groups.get(nam.getName());
              if (groupNo != null) {
                l = l.cons( capture (subject, mr, groupNo.intValue(), o2 ));
              }
            } else if ((nam2=group.testString()) != null) {
              Integer groupNo = o2.named_groups.get(nam2.stringValue());
              if (groupNo != null) {
                l = l.cons( capture (subject, mr, groupNo.intValue(), o2 ));
              }
            } else {
              throw new NotImplemented("named capture groups");
View Full Code Here

    EString str1 = o1.testString();
    EString str2 = o2.testString();
    if (str1 == null || str2 == null)
      throw ERT.badarg(o1, o2);
   
    ErjangConfig.setenv(str1.stringValue(), str2.stringValue());
   
    return ERT.TRUE;
  }
 
  /** os:getenv(string()) -> string() | false */
 
View Full Code Here

    if (str == null)
      throw ERT.badarg(o);

    String value;
   
    value = ErjangConfig.getenv(str.stringValue());
    if (value != null) {
      return EString.fromString(value);
    }
   
    value = System.getenv(str.stringValue());
View Full Code Here

    value = ErjangConfig.getenv(str.stringValue());
    if (value != null) {
      return EString.fromString(value);
    }
   
    value = System.getenv(str.stringValue());

    if (value == null) {
      return ERT.FALSE;
    } else {
      return EString.fromString(value);
View Full Code Here

  public static EAtom list_to_existing_atom(EObject obj) {
    EString seq;
    if ((seq = obj.testString()) == null)
      throw ERT.badarg(obj);
   
    return EAtom.existing_atom(seq.stringValue());
  }
 
  @BIF
  public static EBinary integer_to_binary(EObject arg) {
    EInteger i = arg.testInteger();
View Full Code Here

        }
      }
    }   

    try {
      BigInteger val = new BigInteger(seq.stringValue(), rdx.value);
      return ERT.box(val);
     
    } catch (NumberFormatException e) {
      throw ERT.badarg(obj);
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.