backend/buisnesslogic/src/main/java/com/plannaplan/models/FileData.java

74 lines
1.3 KiB
Java
Raw Normal View History

2020-07-28 17:38:34 +02:00
package com.plannaplan.models;
import java.util.HashMap;
2020-07-28 17:38:34 +02:00
import java.util.Iterator;
import org.apache.poi.ss.usermodel.Row;
2021-01-15 15:54:17 +01:00
/**
* Wrapper for data readed from file
*/
2020-07-28 17:38:34 +02:00
public class FileData {
private HashMap<String, Integer> keys;
2020-07-28 17:38:34 +02:00
private Iterator<Row> rows;
/*
* FileData
*
* @param keys this is a hashmap of String and Integer
2021-01-15 15:54:17 +01:00
*
* @param rows this is a iterator of rows.
*/
public FileData(HashMap<String, Integer> keys, Iterator<Row> rows) {
this.keys = keys;
this.rows = rows;
2020-07-28 17:38:34 +02:00
}
/*
* getRows
*
* @return rows
*/
2020-07-28 17:38:34 +02:00
public Iterator<Row> getRows() {
return rows;
}
/*
* setRows
2021-01-15 15:54:17 +01:00
*
* @param rows set the rows to given function
*/
2020-07-28 17:38:34 +02:00
public void setRows(Iterator<Row> rows) {
this.rows = rows;
}
/*
* getKeys
2021-01-15 15:54:17 +01:00
*
* @return keys
*/
public HashMap<String, Integer> getKeys() {
2020-07-28 17:38:34 +02:00
return keys;
}
/*
* setKeys
2021-01-15 15:54:17 +01:00
*
* @param keys set the key is being a struck of hashmap (String, Integer)
*/
public void setKeys(HashMap<String, Integer> keys) {
2020-07-28 17:38:34 +02:00
this.keys = keys;
}
/*
* getIndexOf
2021-01-15 15:54:17 +01:00
*
* @return index
*/
2020-07-28 18:04:38 +02:00
public int getIndexOf(String key) {
int index = this.keys.get(key);
return index;
}
}