org.simpleflatmapper.jdbc.named.TupleBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sfm-jdbc Show documentation
Show all versions of sfm-jdbc Show documentation
Java library to map flat record - ResultSet, csv - to java object with minimum configuration and low footprint.
package org.simpleflatmapper.jdbc.named;
import java.util.ArrayList;
import java.util.List;
public class TupleBuilder {
private final Symbol word;
private List arguments = new ArrayList(10);
private final int start;
public TupleBuilder(Symbol word, int start) {
this.word = word;
this.start = start;
}
public void add(Symbol argument) {
arguments.add(argument);
}
public Tuple toTuple(int end) {
return new Tuple(word, arguments.toArray(new Symbol[0]), new Position(start, end));
}
public int size() {
return arguments.size();
}
}