/** * Create from something iterable, for instance: * StringList list = new StringList(hashMap.keySet()); * * @nowebref */ public StringList(Iterable<String> iter) { this(10); for (String s : iter) { append(s); } }
/** * Create from something iterable, for instance: * StringList list = new StringList(hashMap.keySet()); * * @nowebref */ public StringList(Iterable<String> iter) { this(10); for (String s : iter) { append(s); } }
public void append(String[] values) { for (String v : values) { append(v); } }
/** Just an alias for append(), but matches pop() */ public void push(String value) { append(value); }
public void append(String[] values) { for (String v : values) { append(v); } }
/** Just an alias for append(), but matches pop() */ public void push(String value) { append(value); }
public void append(StringList list) { for (String v : list.values()) { // will concat the list... append(v); } }
/** Add this value, but only if it's not already in the list. */ public void appendUnique(String value) { if (!hasValue(value)) { append(value); } }
public void append(StringList list) { for (String v : list.values()) { // will concat the list... append(v); } }
/** Add this value, but only if it's not already in the list. */ public void appendUnique(String value) { if (!hasValue(value)) { append(value); } }
/** * Same as exec() above, but prefixes the call with a shell. */ static public int shell(StringList stdout, StringList stderr, String... args) { String shell; String runCmd; StringList argList = new StringList(); if (platform == WINDOWS) { shell = System.getenv("COMSPEC"); runCmd = "/C"; } else { shell = "/bin/sh"; runCmd = "-c"; // attempt emulate the behavior of an interactive shell // can't use -i or -l since the version of bash shipped with macOS does not support this together with -c // also we want to make sure no motd or similar gets returned as stdout argList.append("if [ -f /etc/profile ]; then . /etc/profile >/dev/null 2>&1; fi;"); argList.append("if [ -f ~/.bash_profile ]; then . ~/.bash_profile >/dev/null 2>&1; elif [ -f ~/.bash_profile ]; then . ~/.bash_profile >/dev/null 2>&1; elif [ -f ~/.profile ]; then ~/.profile >/dev/null 2>&1; fi;"); } for (String arg : args) { argList.append(arg); } return exec(stdout, stderr, shell, runCmd, argList.join(" ")); }
/** * Return this dictionary as a String in JSON format. */ public String toJSON() { StringList temp = new StringList(); for (String item : this) { temp.append(JSONObject.quote(item)); } return "[ " + temp.join(", ") + " ]"; }
extraStatements.append(smoothContents[0]); throw new SketchException(context.getResources().getString(R.string.preproc_smooth_and_nosmooth)); } else { extraStatements.append(noContents[0]); extraStatements.append(pixelDensityContents[0]); } else { pixelDensityContents = matchDensityMess(searchArea); if (pixelDensityContents != null) { extraStatements.append(pixelDensityContents[0]);