result set

This commit is contained in:
jackdaw@loafle.com 2017-04-25 16:43:00 +09:00
parent c3ba870834
commit 4a9fca0bbd

View File

@ -11,7 +11,7 @@ import java.util.Map;
* Created by root on 17. 4. 25. * Created by root on 17. 4. 25.
*/ */
public abstract class OFResultSet { public abstract class OFResultSet {
// properties
protected Item item; protected Item item;
protected List<List<String>> rows; protected List<List<String>> rows;
protected Map<String, Integer> meta = null; protected Map<String, Integer> meta = null;
@ -40,7 +40,15 @@ public abstract class OFResultSet {
this.item = item; this.item = item;
} }
// methods
static public OFResultSet newInstance(Item item) {
String type = (String) item.getQuery().getQueryInfo().get("parseDirection");
if (type.equals("row")) {
return new OFResultSetRow(item);
} else {
return new OFResultSetCol(item);
}
}
public OFResultSet(Item item) { public OFResultSet(Item item) {
@ -58,17 +66,9 @@ public abstract class OFResultSet {
return parse(); return parse();
} }
// abstracts
public abstract void setMeta(); public abstract void setMeta();
public abstract Map<String, String> parse(); public abstract Map<String, String> parse();
static public OFResultSet newInstance(Item item) {
String type = (String) item.getQuery().getQueryInfo().get("parseDirection");
if (type.equals("row")) {
return new OFResultSetRow(item);
} else {
return new OFResultSetCol(item);
}
}
} }