use of suite.primitive.Ints.IntsBuilder in project suite by stupidsing.
the class IntOutlet method toList.
public IntsBuilder toList() {
IntsBuilder list = new IntsBuilder();
int c;
while ((c = next()) != IntFunUtil.EMPTYVALUE) list.append(c);
return list;
}
use of suite.primitive.Ints.IntsBuilder in project suite by stupidsing.
the class IntOutlet method toListMap.
public <K> IntObjMap<IntsBuilder> toListMap(Int_Int valueFun) {
IntObjMap<IntsBuilder> map = new IntObjMap<>();
int c;
while ((c = next()) != IntFunUtil.EMPTYVALUE) map.computeIfAbsent(c, k_ -> new IntsBuilder()).append(valueFun.apply(c));
return map;
}
use of suite.primitive.Ints.IntsBuilder in project suite by stupidsing.
the class DevMain method text.
private Text text(IRopeList<Character> text) {
IntsBuilder starts = new IntsBuilder();
IntsBuilder ends = new IntsBuilder();
IntMutable p0 = IntMutable.of(-1);
int size = text.size();
IntSink lf = px -> {
starts.append(p0.get() + 1);
ends.append(px);
p0.update(px);
};
for (int p = 0; p < size; p++) {
char ch = text.get(p);
if (ch == '\n' || wrapSize < p - p0.get())
lf.sink(p);
}
if (1 < size - p0.get())
lf.sink(size);
return new Text(text, starts.toInts().toArray(), ends.toInts().toArray());
}
Aggregations