com.github.kunalk16.excel.model.factory.ExcelWorkBook Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lightExcelReader Show documentation
Show all versions of lightExcelReader Show documentation
A lightweight Java framework to read .xlsx excel files.
package com.github.kunalk16.excel.model.factory;
import com.github.kunalk16.excel.model.user.Sheet;
import com.github.kunalk16.excel.model.user.WorkBook;
import java.util.*;
public class ExcelWorkBook implements WorkBook {
private final Map sheetByName;
private final List sheetList;
public ExcelWorkBook(Map sheetByName) {
this.sheetByName = sheetByName;
this.sheetList = Collections.unmodifiableList(new ArrayList<>(this.sheetByName.values()));
}
@Override
public Sheet getSheet(int index) {
return this.sheetList.get(index);
}
@Override
public Sheet getSheet(String sheetName) {
return this.sheetByName.get(sheetName);
}
@Override
public Collection getSheets() {
return this.sheetByName.values();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy