Package java.lang

Examples of java.lang.StringBuilder$Cell


        this.workingDirPrefix = new String(workingDirPrefix);
    }

    private String makeConfigFileForJavaGrader(MultipartRequest req, File workingDir)
    {
        StringBuilder configString = new StringBuilder();
        //key setting value
        String JUnitTestClassName = req.getParameter("JUnitTestClassName");
        if(null != JUnitTestClassName)
        {
            configString.append("[" + JUnitTestClassName + "]\n");
        }
        else
        {
            System.out.println("There is no JUnitTestClassName provided");
        }

        Enumeration keys = req.getParameterNames();
        while(keys.hasMoreElements())
        {
            String key = (String)keys.nextElement();
            String value = req.getParameter(key);

            if(null != value)
            {
                if(true == value.equalsIgnoreCase("on"))
                    value = "Yes";

                configString.append(key + " = " +  value + "\n");
            }

        }

        // input files to process
        Enumeration files = req.getFileNames();
        while (files.hasMoreElements())
        {
            String name = (String)files.nextElement();
            String filename = req.getFilesystemName(name);
            //String type = req.getContentType(name);
            if(null != filename)
                configString.append(name + " = " + workingDir.getAbsolutePath() + File.separator + filename + "\n");
        }

        //output directory
        File outputDir = new File(workingDir.getAbsolutePath() + File.separator + "output");
        outputDir.mkdirs();
        configString.append("outputDirectory = " + outputDir.getAbsolutePath() + "\n");

        //Feedback directory
        File feedbackDir = new File(workingDir.getAbsolutePath() + File.separator + "FeedBack");
        feedbackDir.mkdirs();

        return configString.toString();
    }
View Full Code Here


        this.workingDirPrefix = new String(workingDirPrefix);
    }

    private String makeConfigFileForJavaGrader(MultipartRequest req, File workingDir)
    {
        StringBuilder configString = new StringBuilder();
        //key setting value
        String JUnitTestClassName = req.getParameter("JUnitTestClassName");
        if(null != JUnitTestClassName)
        {
            configString.append("[" + JUnitTestClassName + "]\n");
        }
        else
        {
            System.out.println("There is no JUnitTestClassName provided");
        }

        Enumeration keys = req.getParameterNames();
        while(keys.hasMoreElements())
        {
            String key = (String)keys.nextElement();
            String value = req.getParameter(key);

            if(null != value)
            {
                if(true == value.equalsIgnoreCase("on"))
                    value = "Yes";

                configString.append(key + " = " +  value + "\n");
            }

        }

        // input files to process
        Enumeration files = req.getFileNames();
        while (files.hasMoreElements())
        {
            String name = (String)files.nextElement();
            String filename = req.getFilesystemName(name);
            //String type = req.getContentType(name);
            if(null != filename)
                configString.append(name + " = " + workingDir.getAbsolutePath() + File.separator + filename + "\n");
        }

        //output directory
        File outputDir = new File(workingDir.getAbsolutePath() + File.separator + "output");
        outputDir.mkdirs();
        configString.append("outputDirectory = " + outputDir.getAbsolutePath() + "\n");

        //Feedback directory
        File feedbackDir = new File(workingDir.getAbsolutePath() + File.separator + "FeedBack");
        feedbackDir.mkdirs();

        return configString.toString();
    }
View Full Code Here

        this.workingDirPrefix = new String(workingDirPrefix);
    }

    private String makeConfigFileForJavaGrader(MultipartRequest req, File workingDir)
    {
        StringBuilder configString = new StringBuilder();
        //key setting value
        String JUnitTestClassName = req.getParameter("JUnitTestClassName");
        if(null != JUnitTestClassName)
        {
            configString.append("[" + JUnitTestClassName + "]\n");
        }
        else
        {
            System.out.println("There is no JUnitTestClassName provided");
        }

        Enumeration keys = req.getParameterNames();
        while(keys.hasMoreElements())
        {
            String key = (String)keys.nextElement();
            String value = req.getParameter(key);

            if(null != value)
            {
                if(true == value.equalsIgnoreCase("on"))
                    value = "Yes";

                configString.append(key + " = " +  value + "\n");
            }

        }

        // input files to process
        Enumeration files = req.getFileNames();
        while (files.hasMoreElements())
        {
            String name = (String)files.nextElement();
            String filename = req.getFilesystemName(name);
            //String type = req.getContentType(name);
            if(null != filename)
                configString.append(name + " = " + workingDir.getAbsolutePath() + File.separator + filename + "\n");
        }

        //output directory
        File outputDir = new File(workingDir.getAbsolutePath() + File.separator + "output");
        outputDir.mkdirs();
        configString.append("outputDirectory = " + outputDir.getAbsolutePath() + "\n");

        //Feedback directory
        File feedbackDir = new File(workingDir.getAbsolutePath() + File.separator + "FeedBack");
        feedbackDir.mkdirs();

        return configString.toString();
    }
View Full Code Here

* Date: 8/14/13
*/
public class StringUtil {

  public static String detailedMapToString(Map map) {
    StringBuilder sb = new StringBuilder();
    sb.append("{\n");
    for(Object key : map.keySet()) {
      sb.append("\t");
      sb.append(String.valueOf(key));
      sb.append(": (");
      Object value = map.get(key);
      sb.append((value==null)? "NULL":value.getClass().getName());
      sb.append(") ");
      sb.append((value==null)? "NULL":String.valueOf(value));
      sb.append("\n");
    }
    sb.append("}");
    return sb.toString();
  }
View Full Code Here

    sb.append("}");
    return sb.toString();
  }

  public static String detailedListToString(List list) {
    StringBuilder sb = new StringBuilder();
    sb.append("{\n");
    for(Object value : list) {
      sb.append("\t");
      sb.append("(");
      sb.append((value==null)? "NULL":value.getClass().getName());
      sb.append(") ");
      sb.append((value==null)? "NULL":String.valueOf(value));
      sb.append("\n");
    }
    sb.append("}");
    return sb.toString();
  }
View Full Code Here

                sender.sendMessage("Unknown tag");
                return false;
            }
            sender.sendMessage("Users in " + tag + " (" + userlists.size() + "):");

            StringBuilder builder = new StringBuilder();
            boolean first = true;

            for (final String string : userlists) {
                if (!first) {
                    builder.append(", ");
                }
                builder.append(string);
                first = false;
            }
            sender.sendMessage(builder.toString());
            return true;
        } catch (final Exception e) {
            e.printStackTrace();
            return false;
        }
View Full Code Here

    public String processAntiHighlight(String input) {
        String delimiter = this.configuration.getString("settings.anti-highlight");

        if (delimiter != null && !delimiter.isEmpty()) {
            StringBuilder builder = new StringBuilder();
            for (int i = 0; i < input.length(); i++) {
                char c = input.charAt(i);
                builder.append(c);
                if (c != '\u00A7') {
                    builder.append(delimiter);
                }
            }
            return builder.toString();
        } else {
            return input;
        }
    }
View Full Code Here

     * @param delim Delimiter to use in the string.
     * @return A string containing the tuple.
     * @throws ExecException if a non-atomic value is found.
     */
    public String toDelimitedString(String delim) throws ExecException {
        StringBuilder buf = new StringBuilder();
        for (Iterator<Object> it = mFields.iterator(); it.hasNext();) {
            Object field = it.next();
            buf.append(field == null ? "" : field.toString());
            if (it.hasNext())
                buf.append(delim);
        }
        return buf.toString();
    }
View Full Code Here

    }


    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append('(');
        for (Iterator<Object> it = mFields.iterator(); it.hasNext();) {
            Object d = it.next();
            if(d != null) {
                if(d instanceof Map) {
                    sb.append(DataType.mapToString((Map<Object, Object>)d));
                } else {
                    sb.append(d.toString());
                    if(d instanceof Long) {
                        sb.append("L");
                    } else if(d instanceof Float) {
                        sb.append("F");
                    }
                }
            } else {
                sb.append("");
            }
            if (it.hasNext())
                sb.append(",");
        }
        sb.append(')');
        return sb.toString();
    }
View Full Code Here

    return result;
  }

  @Override
  public String toString() {
    final StringBuilder sb = new StringBuilder("Val{");
    sb.append("nonFinal=").append(nonFinal);
    sb.append(", otherFinal=").append(otherFinal);
    sb.append('}');
    return sb.toString();
  }
View Full Code Here

TOP

Related Classes of java.lang.StringBuilder$Cell

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.