import java.util.Collections;
import java.util.Map;
import java.util.Optional;
+import java.util.function.Consumer;
import org.simantics.spreadsheet.SpreadsheetVisitor;
import org.simantics.spreadsheet.Spreadsheets;
}
+ public String getLinesPath() {
+ return getName();
+ }
+
+ public void forLines(Consumer<SpreadsheetLine> consumer, int min, int max) {
+
+ int i=1;
+ int n = (keys.length - 1) / 2;
+
+ // Smaller keys
+ while(i <= n && min > getKey(i-1)) i++;
+
+ while(i <= n && max > getKey(i-1)) {
+
+ int nodeName = getChild(i-1);
+
+ SpreadsheetLines node = nodes.get(nodeName);
+ if(node == null) {
+ consumer.accept(lines.get(-getKey(i-1)));
+ } else {
+ node.forLines(consumer, min, max);
+ }
+
+ i++;
+
+ }
+
+ }
+
public int getMaxRow() {
// if keys == null then this is the root of BTree which has only one child
if (keys == null) {