All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.kunalk16.excel.model.factory.ExcelWorkBook Maven / Gradle / Ivy

There is a newer version: 1.0.2
Show newest version
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