mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
add join() method to Int/Float/StringList
This commit is contained in:
@@ -749,6 +749,20 @@ public class FloatList implements Iterable<Float> {
|
||||
}
|
||||
|
||||
|
||||
public String join(String separator) {
|
||||
if (count == 0) {
|
||||
return "";
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(data[0]);
|
||||
for (int i = 1; i < count; i++) {
|
||||
sb.append(separator);
|
||||
sb.append(data[i]);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
@@ -757,6 +757,20 @@ public class IntList implements Iterable<Integer> {
|
||||
}
|
||||
|
||||
|
||||
public String join(String separator) {
|
||||
if (count == 0) {
|
||||
return "";
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(data[0]);
|
||||
for (int i = 1; i < count; i++) {
|
||||
sb.append(separator);
|
||||
sb.append(data[i]);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
@@ -688,6 +688,20 @@ public class StringList implements Iterable<String> {
|
||||
// }
|
||||
|
||||
|
||||
public String join(String separator) {
|
||||
if (count == 0) {
|
||||
return "";
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(data[0]);
|
||||
for (int i = 1; i < count; i++) {
|
||||
sb.append(separator);
|
||||
sb.append(data[i]);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
@@ -28,6 +28,7 @@ X perhaps it's a getGraphics() issue?
|
||||
X when using increment() on IntList, make sure the index exists
|
||||
X automatically resize the list if necessary
|
||||
X (this is more in keeping with increment() in the Dict classes)
|
||||
X add join() method to Int/Float/StringList
|
||||
|
||||
cleaning
|
||||
X load/save methods.. is it save("blah.svg") or saveSVG("blah.svg")
|
||||
@@ -41,6 +42,8 @@ _ https://github.com/processing/processing/issues/2012
|
||||
_ add option to have full screen span across screens
|
||||
_ display=all in cmd line
|
||||
_ sketchDisplay() -> 0 for all, or 1, 2, 3...
|
||||
_ add optional/default values for get methods in JSON
|
||||
_ add isNull() method back to JSONObject/Array
|
||||
|
||||
_ test PGraphicsRetina2D w/ 7u40
|
||||
_ make sure that 7u40 doesn't reintroduce starvation issue on retina Macs
|
||||
|
||||
Reference in New Issue
Block a user