Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangString.stringValue()


      .substring(3));
    return o;
      } else if (atomValue.equals("codepointBug")
        && i instanceof OtpErlangString) {
    final OtpErlangString s = (OtpErlangString) i;
    final String ss = s.stringValue().substring(3, 6);
        @SuppressWarnings("unused")
    final int[] cps = OtpErlangString.stringToCodePoints(ss);
    return s;
      } else if (atomValue.equals("utf8")) {
    if (i instanceof OtpErlangString) {
View Full Code Here


      } else if (atomValue.equals("utf8")) {
    if (i instanceof OtpErlangString) {
        final OtpErlangString s = (OtpErlangString) i;
        byte[] bytes;
        try {
      bytes = s.stringValue().getBytes("UTF-8");
        } catch (final UnsupportedEncodingException e) {
      bytes = new byte[] { 'e', 'r', 'r', 'o', 'r' };
        }
        final OtpErlangBinary b = new OtpErlangBinary(bytes);
        return b;
View Full Code Here

      oes = new OtpErlangString(oel);
        } catch (final Exception e) {
        }
    }
    if (oes != null) {
        String s = oes.stringValue();
        int n = s.length();
        OtpErlangObject l[] = new OtpErlangObject[n];
        for (int j = 0;  j < n;  j++) {
      int c = s.charAt(j);
      l[j] = new OtpErlangInt(-c);
View Full Code Here

        return new OtpErlangList(l);
    }
      } else if(atomValue.equals("to_neg_int_list")) {
    if (i instanceof OtpErlangString) {
        OtpErlangString oes = (OtpErlangString) i;
        OtpErlangList oel = new OtpErlangList(oes.stringValue());
        int n = oel.arity();
        OtpErlangObject l[] = new OtpErlangObject[n];
        for (int j = 0;  j < n;  j++) {
      OtpErlangLong c = (OtpErlangLong) oel.elementAt(j);
      l[j] = new OtpErlangInt(-c.intValue());
View Full Code Here

    static OtpErlangList otpObjectToOtpList(final OtpErlangObject value)
            throws ClassCastException {
        // need special handling if OTP thought that the value is a string
        if (value instanceof OtpErlangString) {
            final OtpErlangString value_string = (OtpErlangString) value;
            return new OtpErlangList(value_string.stringValue());
        } else {
            return (OtpErlangList) value;
        }
    }
View Full Code Here

                            + ") failed with timeout: " + e.getMessage());
                } catch (final UnknownException e) {
                    System.out.println("      read(" + otpKey.stringValue()
                            + ") failed with unknown: " + e.getMessage());
                } catch (final NotFoundException e) {
                    System.out.println("      read(" + otpKey.stringValue()
                            + ") failed with not found: " + e.getMessage());
                } catch (final ClassCastException e) {
                    System.out.println("      read(" + otpKey.stringValue()
                            + ") failed with unknown return type: " + e.getMessage());
                }
View Full Code Here

                            + ") failed with unknown: " + e.getMessage());
                } catch (final NotFoundException e) {
                    System.out.println("      read(" + otpKey.stringValue()
                            + ") failed with not found: " + e.getMessage());
                } catch (final ClassCastException e) {
                    System.out.println("      read(" + otpKey.stringValue()
                            + ") failed with unknown return type: " + e.getMessage());
                }
            }

            System.out.println("    `String read(String)`...");
View Full Code Here

            System.out.println("  creating object...");
            final PubSub sc = new PubSub();
            System.out
                    .println("    `OtpErlangList getSubscribers(OtpErlangString)`...");
            otpSubscribers = (OtpErlangList) sc.getSubscribers(otpTopic).value();
            System.out.println("      getSubscribers(" + otpTopic.stringValue()
                    + ") == " + getSubscribers(otpSubscribers));
        } catch (final ConnectionException e) {
            System.out.println("      getSubscribers(" + otpTopic.stringValue()
                    + ") failed: " + e.getMessage());
        } catch (final UnknownException e) {
View Full Code Here

                    .println("    `OtpErlangList getSubscribers(OtpErlangString)`...");
            otpSubscribers = (OtpErlangList) sc.getSubscribers(otpTopic).value();
            System.out.println("      getSubscribers(" + otpTopic.stringValue()
                    + ") == " + getSubscribers(otpSubscribers));
        } catch (final ConnectionException e) {
            System.out.println("      getSubscribers(" + otpTopic.stringValue()
                    + ") failed: " + e.getMessage());
        } catch (final UnknownException e) {
            System.out.println("    getSubscribers(" + otpTopic.stringValue()
                    + ") failed: " + e.getMessage());
        }
View Full Code Here

                    + ") == " + getSubscribers(otpSubscribers));
        } catch (final ConnectionException e) {
            System.out.println("      getSubscribers(" + otpTopic.stringValue()
                    + ") failed: " + e.getMessage());
        } catch (final UnknownException e) {
            System.out.println("    getSubscribers(" + otpTopic.stringValue()
                    + ") failed: " + e.getMessage());
        }

        try {
            System.out.println("  creating object...");
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.