This commit is contained in:
Redkale
2016-10-28 11:54:10 +08:00
parent 00ba1ecee9
commit aae2305274

View File

@@ -67,7 +67,7 @@ public class Sheet<T> implements java.io.Serializable, Iterable<T> {
@Override
public String toString() {
return "Sheet[total=" + this.total + ", rows=" + this.rows + "]";
return "{\"total\":" + this.total + ", \"rows\":" + this.rows + "}";
}
public long getTotal() {
@@ -107,6 +107,12 @@ public class Sheet<T> implements java.io.Serializable, Iterable<T> {
}
}
public void forEachParallel(final Consumer<? super T> consumer) {
if (consumer != null && this.rows != null && !this.rows.isEmpty()) {
this.rows.parallelStream().forEach(consumer);
}
}
@Override
public Spliterator<T> spliterator() {
return (this.rows == null) ? new ArrayList<T>().spliterator() : this.rows.spliterator();