From 735944f018fd2635a4ce6fce1cb9258f66aa3535 Mon Sep 17 00:00:00 2001 From: snoop Date: Tue, 25 Apr 2017 16:15:21 +0900 Subject: [PATCH] changed meta list => map --- .../overflow/crawler/result/OFResultSet.java | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) 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 546a874..dc89a32 100644 --- a/src/main/java/com/loafle/overflow/crawler/result/OFResultSet.java +++ b/src/main/java/com/loafle/overflow/crawler/result/OFResultSet.java @@ -3,6 +3,7 @@ package com.loafle.overflow.crawler.result; import com.loafle.overflow.crawler.config.Item; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -13,7 +14,7 @@ public class OFResultSet { private Item item; private List> rows; - private List meta; + private Map meta = null; public List> getRows() { return rows; @@ -32,12 +33,16 @@ public class OFResultSet { } - public List getMeta() { - return meta; - } - public void setMeta(List meta) { - this.meta = meta; + + if(this.meta == null) { + this.meta = new HashMap<>(); + } + + for(int indexI = 0; indexI < meta.size(); ++indexI) { + this.meta.put(meta.get(indexI), indexI); + } + } public OFResultSet(Item item) { @@ -47,7 +52,7 @@ public class OFResultSet { public OFResultSet(Item item,List meta) { this.item = item; this.rows = new ArrayList<>(); - this.meta = meta; + this.setMeta(meta); } public void addRow(List row) { @@ -65,6 +70,11 @@ public class OFResultSet { } public Map parseCol() { + + + + + return null; }