Package erjang

Examples of erjang.EString$SubSequence


    return eos.getBinaryContent();   
  }

  @BIF
  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());
  }
View Full Code Here


    return EBinary.make(bin);
  }

  @BIF
  public static EInteger list_to_integer(EObject obj, EObject radix) {
    EString seq;
    ESmall rdx;
    if ((seq = obj.testString()) == null
        || ((rdx = radix.testSmall()) == null))
      throw ERT.badarg(obj, radix);

    // remove leading +
    if (!seq.isNil()) {
    if (seq.head().equalsExactly(PLUS_SIGN)) {
        seq = seq.tail().testString();
       
        if (seq == null) {
          throw ERT.badarg(obj);
        }
      }
    }   

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

  }
 
 
  @BIF
  public static EInteger list_to_integer(EObject obj) {
    EString seq;
    if ((seq = obj.testString()) == null)
      throw ERT.badarg(obj);

    // remove leading +
    if (!seq.isNil()) {
      if (seq.head().equalsExactly(PLUS_SIGN)) {
        seq = seq.tail().testString();
       
        if (seq == null) {
          throw ERT.badarg(obj);
        }
      }
    }   

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

   
  }

  @BIF
  public static EDouble list_to_float(EObject obj) {
    EString seq;
    if ((seq = obj.testString()) == null)
      throw ERT.badarg(obj);
   
    String string = seq.stringValue();
    if (string.length() == 0
      || string.charAt(0) == '.'
      || string.charAt(string.length()-1) == '.'
      || string.indexOf('.') == -1) {
      throw ERT.badarg(obj);
View Full Code Here

  @BIF
  public static EString ref_to_list(EObject obj) {
    ERef ref = obj.testReference();
    if (ref == null)
      throw ERT.badarg(obj);
    return new EString(ref.toString());
  }
View Full Code Here

            public void ready() throws Pausable {
              if (task.send_binary_data) {
                EBinary out = new EBinary(ob);
                task.output_from_driver(out);
              } else {
                EString str = EString.make(ob);
                task.output_from_driver(str);
              }
            }
           
            @Override
View Full Code Here

    return res;
  }
 
  @BIF
  public static EBinary list_to_binary(EObject val) {
    EString es;
    if ((es = val.testString()) != null) {
      return es.asBitString();
    }

    ECons cons = val.testCons();
    if (cons == null) throw ERT.badarg(val);
    List<ByteBuffer> out = new ArrayList<ByteBuffer>();
View Full Code Here

    EBinary bin;
    if ((bin=val.testBinary()) != null) {
      return new ESmall(bin.byteSize());
    }
   
    EString str;
    if ((str=val.testString()) != null) {
      return new ESmall(str.length());
    }
   
   
    ECons seq;
    if ((seq = val.testCons()) == null) {
View Full Code Here

  @BIF
  static public EString integer_to_list(EObject obj) {
    EInteger num;
    if ((num = obj.testInteger()) != null) {
      return new EString(num.toString());
    }
    throw ERT.badarg(obj);
  }
View Full Code Here

  }

  @BIF
 
  static public EAtom list_to_atom(EObject obj) {
    EString es;
    if ((es = obj.testString()) != null) {
      return EAtom.intern(es.stringValue());
    }
    throw ERT.badarg(obj);
  }
View Full Code Here

TOP

Related Classes of erjang.EString$SubSequence

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.