public StringList copy() { StringList outgoing = new StringList(data); outgoing.count = count; return outgoing; }
public StringList copy() { StringList outgoing = new StringList(data); outgoing.count = count; return outgoing; }
public StringList getSubset(int start, int num) { String[] subset = new String[num]; System.arraycopy(data, start, subset, 0, num); return new StringList(subset); }
public StringList getSubset(int start, int num) { String[] subset = new String[num]; System.arraycopy(data, start, subset, 0, num); return new StringList(subset); }
public StringList getStringList(int column) { return new StringList(getStringColumn(column)); }
public StringList getStringList(String columnName) { return new StringList(getStringColumn(columnName)); }
public StringList getStringList(String columnName) { return new StringList(getStringColumn(columnName)); }
public StringList getStringList(int column) { return new StringList(getStringColumn(column)); }
/** * @param method "size" or "fullScreen" * @param args parameters passed to the function so we can show the user * @return true if safely inside the settings() method */ boolean insideSettings(String method, Object... args) { if (insideSettings) { return true; } final String url = "https://processing.org/reference/" + method + "_.html"; if (!external) { // post a warning for users of Eclipse and other IDEs StringList argList = new StringList(args); System.err.println("When not using the PDE, " + method + "() can only be used inside settings()."); System.err.println("Remove the " + method + "() method from setup(), and add the following:"); System.err.println("public void settings() {"); System.err.println(" " + method + "(" + argList.join(", ") + ");"); System.err.println("}"); } throw new IllegalStateException(method + "() cannot be used here, see " + url); }
/** * Return this dictionary as a String in JSON format. */ public String toJSON() { StringList items = new StringList(); for (int i = 0; i < count; i++) { items.append(JSONObject.quote(keys[i])+ ": " + values[i]); } return "{ " + items.join(", ") + " }"; }
/** * Return this dictionary as a String in JSON format. */ public String toJSON() { StringList items = new StringList(); for (int i = 0; i < count; i++) { items.append(JSONObject.quote(keys[i])+ ": " + values[i]); } return "{ " + items.join(", ") + " }"; }
public String[] getUnique(int column) { StringList list = new StringList(getStringColumn(column)); return list.getUnique(); }
public IntDict getOrder(int column) { StringList list = new StringList(getStringColumn(column)); return list.getOrder(); }
public IntDict getTally(int column) { StringList list = new StringList(getStringColumn(column)); return list.getTally(); }
public String[] getUnique(int column) { StringList list = new StringList(getStringColumn(column)); return list.getUnique(); }
public IntDict getOrder(int column) { StringList list = new StringList(getStringColumn(column)); return list.getOrder(); }
public IntDict getTally(int column) { StringList list = new StringList(getStringColumn(column)); return list.getTally(); }
/** * Return this dictionary as a String in JSON format. */ public String toJSON() { StringList items = new StringList(); for (int i = 0; i < count; i++) { items.append(JSONObject.quote(keys[i])+ ": " + JSONObject.quote(values[i])); } return "{ " + items.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(", ") + " ]"; }
/** * Create a dictionary that maps between column titles and cell entries * in a TableRow. If two columns have the same name, the later column's * values will override the earlier values. */ public StringDict(TableRow row) { this(row.getColumnCount()); String[] titles = row.getColumnTitles(); if (titles == null) { titles = new StringList(IntList.fromRange(row.getColumnCount())).array(); } for (int col = 0; col < row.getColumnCount(); col++) { set(titles[col], row.getString(col)); } // remove unused and overwritten entries crop(); }