From f8e722e4d5c278cdb23262a579c892845730d29d Mon Sep 17 00:00:00 2001 From: "jackdaw@loafle.com" Date: Tue, 25 Apr 2017 16:39:58 +0900 Subject: [PATCH] result set --- .../com/loafle/overflow/crawler/result/OFResultSet.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/loafle/overflow/crawler/result/OFResultSet.java b/src/main/java/com/loafle/overflow/crawler/result/OFResultSet.java index 6d01264..3c860ae 100644 --- a/src/main/java/com/loafle/overflow/crawler/result/OFResultSet.java +++ b/src/main/java/com/loafle/overflow/crawler/result/OFResultSet.java @@ -62,5 +62,13 @@ public abstract class OFResultSet { public abstract Map parse(); + 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); + } + } }