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; }