Java String Format formatVarname(StringBuilder buffer, Object varname)

Here you can find the source of formatVarname(StringBuilder buffer, Object varname)

Description

format Varname

License

Open Source License

Declaration

public static void formatVarname(StringBuilder buffer, Object varname) 

Method Source Code

//package com.java2s;
/*/*from w  w  w  .j av  a  2  s. c  om*/
** Copyright 2009-2014 by LivingLogic AG, Bayreuth/Germany
** All Rights Reserved
** See LICENSE for the license
*/

import java.util.List;

public class Main {
    public static void formatVarname(StringBuilder buffer, Object varname) {
        if (varname instanceof String)
            buffer.append((String) varname);
        else {
            List varnames = (List) varname;
            buffer.append("(");
            int count = 0;
            for (Object subvarname : varnames) {
                ++count;
                formatVarname(buffer, subvarname);
                if (count == 1 || count != varnames.size())
                    buffer.append(", ");
            }
            buffer.append(")");
        }
    }
}

Related

  1. formatProtein(String seq)
  2. formatString(String stringFormat, String... args)
  3. formatStringTo80Columns(String str)
  4. formatTooltip(String tooltip)
  5. formatTreeLines(String tree)
  6. formatWords(String words, String delimiter, boolean isHeaderUpperCase)
  7. getAnswerKey(String itemFormat)
  8. getCodeFileName(String fileNameFormat, String randomCode)
  9. getDBPediaFormatDescriptions( String descriptionStr)