Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangLong


    public ErlangFunction(final OtpErlangTuple tuple) {
        OtpErlangAtom a;
        arity = 0;
        if (tuple.arity() == 2) {
            a = (OtpErlangAtom) tuple.elementAt(0);
            final OtpErlangLong l = (OtpErlangLong) tuple.elementAt(1);
            try {
                arity = l.intValue();
            } catch (final OtpErlangRangeException e) {
            }
        } else {
            a = (OtpErlangAtom) tuple.elementAt(2);
            final OtpErlangObject parameters = tuple.elementAt(3);
            if (parameters instanceof OtpErlangLong) {
                final OtpErlangLong l = (OtpErlangLong) parameters;
                try {
                    arity = l.intValue();
                } catch (final OtpErlangRangeException e) {
                }
            } else if (parameters instanceof OtpErlangList) {
                final OtpErlangList l = (OtpErlangList) parameters;
                arity = l.arity();
            }
        }
        name = a.atomValue();
    }
View Full Code Here


        return ErlangFunction.getNameWithParameters(name, arity);
    }

    public OtpErlangTuple getNameArityTuple() {
        return new OtpErlangTuple(new OtpErlangObject[] { new OtpErlangAtom(name),
                new OtpErlangLong(arity) });
    }
View Full Code Here

            }
            SyntaxInfo ret;
            final OtpErlangTuple res = (OtpErlangTuple) result.elementAt(1);
            final OtpErlangTuple position = (OtpErlangTuple) ((OtpErlangList) res
                    .elementAt(1)).elementAt(0);
            OtpErlangLong line, col;
            line = (OtpErlangLong) position.elementAt(0);
            col = (OtpErlangLong) position.elementAt(0);
            ret = new SyntaxInfo(Type.VARIABLE, line.intValue(), col.intValue());
            return ret;
        } catch (final Exception e) {
            ErlLogger.debug(e);
            return null;
        }
View Full Code Here

          OtpErlangObject stateNamesAsObject = message.elementAt(startFrom+1);
          setStateNamesToBeIgnored(((LayoutOptions)fsmPicture.getUserDatum(JUConstants.LAYOUTOPTIONS)),stateNamesAsObject);
        }
        if (message.arity() > startFrom+2)
        {
          OtpErlangLong windowNum = ((OtpErlangLong)message.elementAt(startFrom+2));windowNumber = windowNum.intValue();
        }
        if (message.arity() > startFrom+3)
        {
          OtpErlangLong abstraction = ((OtpErlangLong)message.elementAt(startFrom+3));
          ((LayoutOptions)fsmPicture.getUserDatum(JUConstants.LAYOUTOPTIONS)).componentsToPick=abstraction.intValue();
        }
      }
      return windowNumber;
    }
View Full Code Here

      return singleton;
    }

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

      if (partB == null && partExp == null) {// integer/long
        if (partA.startsWith("+"))
          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)
View Full Code Here

  }
 
  @Test
  public void testEvaluateTerm1()
  {
    Assert.assertEquals(new OtpErlangLong(25),runner.evaluateString("25"));
  }
View Full Code Here

      return singleton;
    }

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

      if (partB == null && partExp == null) {// integer/long
        if (partA.startsWith("+"))
          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)
View Full Code Here

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

TOP

Related Classes of com.ericsson.otp.erlang.OtpErlangLong

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.