Example usage for java.lang String toString

List of usage examples for java.lang String toString

Introduction

In this page you can find the example usage for java.lang String toString.

Prototype

public String toString() 

Source Link

Document

This object (which is already a string!) is itself returned.

Usage

From source file:Main.java

public static boolean instantExec_prev2(Context context, String command) {
    try {//  w  w w  .ja v  a 2s.  c o m
        runSuCommand_prev2(context, command.toString());
    } catch (Exception e) {
        return false;
    }
    return true;
}

From source file:Main.java

public static boolean instantExec_spica2(Context context, String command) {
    try {/*from  w w w.  j a  va  2 s .com*/
        runSuCommand_spica2(context, command.toString());
    } catch (Exception e) {
        return false;
    }
    return true;
}

From source file:Main.java

public static boolean instantExec_miracle(Context context, String command) {
    try {//from   w  w  w  . j a  va 2 s  . c  om
        runSuCommand_miracle(context, command.toString());
    } catch (Exception e) {
        return false;
    }
    return true;
}

From source file:Main.java

public static boolean instantExec_miracle2(Context context, String command) {
    try {/*  w  ww.j  a  v a2s. c om*/
        runSuCommand_miracle2(context, command.toString());
    } catch (Exception e) {
        return false;
    }
    return true;
}

From source file:edu.stanford.muse.index.Trace.java

public static void trace(Object message, Object o) {
    if (traceTerms.size() == 0)
        return;//from w w  w .j  av a  2s .  com
    String s = o.toString();
    for (String traceTerm : traceTerms)
        if (s.toString().toLowerCase().indexOf(traceTerm) >= 0)
            log.info(message + ": " + s);
}

From source file:edu.stanford.muse.index.Trace.java

public static void trace(Object message1, Object message2, Object o) {
    if (traceTerms.size() == 0)
        return;/*w  w  w. j  av a  2 s . c  o m*/
    String s = o.toString();
    for (String traceTerm : traceTerms)
        if (s.toString().toLowerCase().indexOf(traceTerm) >= 0)
            log.info(message1 + ": " + message2 + ": " + s);
}

From source file:edu.stanford.muse.index.Trace.java

public static void trace(Object message1, Object message2, Object message3, Object o) {
    if (traceTerms.size() == 0)
        return;/* w w  w .  jav a  2s  .c o  m*/
    String s = o.toString();
    for (String traceTerm : traceTerms)
        if (s.toString().toLowerCase().indexOf(traceTerm) >= 0)
            log.info(message1 + ": " + message2 + ": " + message3 + ": " + s);
}

From source file:Main.java

public static String encodeXML(String xml) {

    if (xml == null)
        return "";

    char[] chars = xml.toString().toCharArray();

    StringBuffer out = new StringBuffer();

    for (char c : chars)
        switch (c) {
        case '&':
            out.append("&");

            break;

        case '<':
            out.append("&lt;");

            break;

        case '>':
            out.append("&gt;");

            break;

        case '\"':
            out.append("&quot;");

            break;

        default:/*ww  w  .ja va 2  s.c  o m*/
            out.append(c);
        }

    return out.toString();
}

From source file:Main.java

@SuppressLint("SimpleDateFormat")
public static String getTimes(String times) {
    String time = "";
    try {//from   www.  j av  a 2s.c  o  m
        Date epoch = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").parse(times.toString().substring(8, 10) + "/"
                + times.toString().substring(5, 7) + "/" + times.toString().substring(0, 4) + " 01:00:00");
        time = epoch.getTime() / 1000 + "";
    } catch (ParseException e) {
        e.printStackTrace();
    }
    return time;
}

From source file:Main.java

/**
 * Transforms a collection of strings into a comma delimited string, where
 * each component get single-quoted.//  www.j a va2  s.c om
 *
 * @param elements the collection of Integers
 * @return a comma delimited String.
 */
public static String getQuotedCommaDelimitedString(Collection<String> elements) {
    if (elements != null && elements.size() > 0) {
        final StringBuffer buffer = new StringBuffer();

        for (String element : elements) {
            buffer.append("'").append(element.toString()).append("', ");
        }

        return buffer.substring(0, buffer.length() - ", ".length());
    }

    return null;
}