Examples of OtpErlangInt


Examples of com.ericsson.otp.erlang.OtpErlangInt

  }
 
  @Test
  public void testToString8()
  {
    Assert.assertEquals("-234",ErlangLabel.dumpErlangObject(new OtpErlangInt(-234)));
  }
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangInt

        ErlangLabel.dumpErlangObject(new OtpErlangTuple(new OtpErlangObject[]{
            new OtpErlangAtom("this is an atom"),
            new OtpErlangString("this is a string"),
            new OtpErlangList(new OtpErlangObject[]{
                new OtpErlangList(new OtpErlangObject[]{
                    new OtpErlangInt(-234)
                }),
                new OtpErlangTuple(new OtpErlangObject[]{
                })
            })
        })));
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangInt

 
  @Test
  public void testParse3()
  {
    String text = " -45 ";
    OtpErlangInt number = (OtpErlangInt)ErlangLabel.parseText(text);
    Assert.assertEquals(-45,number.longValue());
    Assert.assertEquals(text.trim(),ErlangLabel.dumpErlangObject(ErlangRunner.getRunner().evaluateString(text)));
  }
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangInt

 
  @Test
  public void testParse4()
  {
    String text = " 45 ";
    OtpErlangInt number = (OtpErlangInt)ErlangLabel.parseText(text);
    Assert.assertEquals(45,number.longValue());
    Assert.assertEquals(text.trim(),ErlangLabel.dumpErlangObject(ErlangRunner.getRunner().evaluateString(text)));
  }
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangInt

    Assert.assertEquals(new OtpErlangTuple(new OtpErlangObject[]{
            new OtpErlangAtom("this is an atom"),
            new OtpErlangString("this is a string"),
            new OtpErlangList(new OtpErlangObject[]{
                new OtpErlangList(new OtpErlangObject[]{
                    new OtpErlangInt(-234)
                }),
                new OtpErlangTuple(new OtpErlangObject[]{
                })
            })
        }),obtained);
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangInt

      // The above loads a module, this one gets that module and subsequently updates its alphabet.
      ErlangModule mod = ErlangModule.findModule(evalConf.config.getErlangModuleName());
     
      final ErlangLabel initLabel = mod.behaviour.convertErlToMod(AbstractLearnerGraph.generateNewLabel("{"+ErlangLabel.missingFunction+",'init','AnyWibble','ok'}", evalConf.config)),
      labelLock = mod.behaviour.convertErlToMod(AbstractLearnerGraph.generateNewLabel("{"+ErlangLabel.missingFunction+",'call','lock',{'ok','locked'}}", evalConf.config));
    final ErlangLabel labelInvalidRead = new ErlangLabel(labelLock.function,labelLock.callName,labelLock.input,new OtpErlangInt(88));
    statechum.Helper.checkForCorrectException(new statechum.Helper.whatToRun() {
      public @Override void run() {
        learner.askErlang(Arrays.asList(new Label[]{initLabel,labelLock,labelInvalidRead}));
      }},IllegalArgumentException.class,"does not belong");
    }
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangInt

          partA = partA.substring(1);
        long outcome = Long.parseLong(partA);
        if (outcome > Integer.MAX_VALUE || outcome < Integer.MIN_VALUE)
          result = new OtpErlangLong(outcome);
        else
          result = new OtpErlangInt((int) outcome);
      } else {// floating - point number.
        String textToParse = partA + "."
            + (partB == null ? "0" : partB)
            + (partExp == null ? "" : ("e" + partExp));
        if (partExp != null) {
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangInt

      return singleton;
    }

    @Override
    public void dump(OtpErlangObject arg, StringBuffer resultHolder) {
      OtpErlangInt longValue = (OtpErlangInt) arg;
      resultHolder.append(longValue.longValue());
    }
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangInt

            value = new OtpErlangDouble(
                ((Double) outcome).doubleValue());
          else if (outcome.getClass().equals(String.class))
            value = new OtpErlangAtom((String) outcome);
          else if (outcome.getClass().equals(Integer.class))
            value = new OtpErlangInt(((Integer) outcome).intValue());
          else if (outcome.getClass().equals(Long.class))
            value = new OtpErlangLong(((Long) outcome).longValue());
          else
            value = new OtpErlangAtom(outcome.toString());
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangInt

    String arg2 = "arg2";
    String arg3 = "arg3";
    boolean arg4 = true;

    OtpErlangObject[] smallTupleContent = new OtpErlangObject[2];
    smallTupleContent[0] = new OtpErlangInt(arg1);
    smallTupleContent[1] = new OtpErlangString(arg2);
    OtpErlangTuple smallTuple = new OtpErlangTuple(smallTupleContent);
    OtpErlangObject[] structuredTupleContent = new OtpErlangObject[3];
    structuredTupleContent[0] = smallTuple;
    structuredTupleContent[1] = new OtpErlangString(arg3);
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.