Major refactor of reading from excel to db

This commit is contained in:
Maciek Głowacki
2020-09-21 17:45:52 +02:00
parent e91965e9b5
commit c449bc22e1
16 changed files with 158 additions and 167 deletions

View File

@ -1,20 +1,25 @@
package com.plannaplan.models;
import java.util.Dictionary;
import java.util.HashMap;
import java.util.Iterator;
import org.apache.poi.ss.usermodel.Row;
//dictionary is deprecated use hashmap instead
public class FileData {
private Dictionary<String, Integer> keys;
private HashMap<String, Integer> keys;
private Iterator<Row> rows;
public FileData(Dictionary<String, Integer> keys, Iterator<Row> rows) {
this.setKeys(keys);
this.setRows(rows);
//why variable is called keys2, could it be more specific???
//why use setters in constructor here instead of assignments???
// thought that setters are used to change values in runtime
public FileData(HashMap<String, Integer> keys, Iterator<Row> rows) {
this.keys = keys;
this.rows = rows;
}
public Iterator<Row> getRows() {
return rows;
}
@ -23,11 +28,11 @@ public class FileData {
this.rows = rows;
}
public Dictionary<String, Integer> getKeys() {
public HashMap<String, Integer> getKeys() {
return keys;
}
public void setKeys(Dictionary<String, Integer> keys) {
public void setKeys(HashMap<String, Integer> keys) {
this.keys = keys;
}