changed metamap

This commit is contained in:
snoop 2017-04-26 20:10:33 +09:00
parent 9a5a8f696c
commit 7f6fe40dae
2 changed files with 8 additions and 11 deletions

View File

@ -110,7 +110,7 @@ public class WMICrawlerLinux extends WMICrawlerOS {
continue;
}
row = new ArrayList<>();
row = new ArrayList<>(Arrays.asList(new String[metaMap.size()]));
String[] datas = line.split(DELIMITER_SPLIT);
@ -118,8 +118,8 @@ public class WMICrawlerLinux extends WMICrawlerOS {
tempMap.put(columns.get(indexJ), datas[indexJ]);
}
for(String key : metaMap.keySet()) {
row.add(tempMap.get(key));
for (Map.Entry<String, Integer> info : metaMap.entrySet()) {
row.set(info.getValue().intValue(), tempMap.get(info.getKey()));
}

View File

@ -10,10 +10,7 @@ import com.loafle.overflow.crawler.config.Query;
import com.loafle.overflow.crawler.result.OFResultSet;
import com.loafle.overflow.crawler.result.OFResultSetCol;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* Created by snoop on 2017-04-11.
@ -62,16 +59,16 @@ public class WMICrawlerWindows extends WMICrawlerOS {
while (enumVariant.hasMoreElements()) {
row = new ArrayList<>();
row = new ArrayList<>(Arrays.asList(new String[metaMap.size()]));
vItem = enumVariant.nextElement();
item = vItem.toDispatch();
for( String key : metaMap.keySet()) {
vValue = Dispatch.call(item, key);
for (Map.Entry<String, Integer> info : metaMap.entrySet()) {
vValue = Dispatch.call(item, info.getKey());
value = vValue.toString();
vValue.safeRelease();
row.add(value);
row.set(info.getValue().intValue(), value);
}
vItem.safeRelease();