74 lines
1.3 KiB
Java
Executable File
74 lines
1.3 KiB
Java
Executable File
package com.plannaplan.models;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.Iterator;
|
|
import org.apache.poi.ss.usermodel.Row;
|
|
|
|
/**
|
|
* Wrapper for data readed from file
|
|
*/
|
|
public class FileData {
|
|
|
|
private HashMap<String, Integer> keys;
|
|
private Iterator<Row> rows;
|
|
|
|
/*
|
|
* FileData
|
|
*
|
|
* @param keys this is a hashmap of String and Integer
|
|
*
|
|
* @param rows this is a iterator of rows.
|
|
*/
|
|
public FileData(HashMap<String, Integer> keys, Iterator<Row> rows) {
|
|
this.keys = keys;
|
|
this.rows = rows;
|
|
}
|
|
|
|
/*
|
|
* getRows
|
|
*
|
|
* @return rows
|
|
*/
|
|
public Iterator<Row> getRows() {
|
|
return rows;
|
|
}
|
|
|
|
/*
|
|
* setRows
|
|
*
|
|
* @param rows set the rows to given function
|
|
*/
|
|
public void setRows(Iterator<Row> rows) {
|
|
this.rows = rows;
|
|
}
|
|
|
|
/*
|
|
* getKeys
|
|
*
|
|
* @return keys
|
|
*/
|
|
public HashMap<String, Integer> getKeys() {
|
|
return keys;
|
|
}
|
|
|
|
/*
|
|
* setKeys
|
|
*
|
|
* @param keys set the key is being a struck of hashmap (String, Integer)
|
|
*/
|
|
public void setKeys(HashMap<String, Integer> keys) {
|
|
this.keys = keys;
|
|
}
|
|
|
|
/*
|
|
* getIndexOf
|
|
*
|
|
* @return index
|
|
*/
|
|
public int getIndexOf(String key) {
|
|
int index = this.keys.get(key);
|
|
return index;
|
|
}
|
|
|
|
}
|