org.nuiton.eugene.writer.WriterReport Maven / Gradle / Ivy
/*
* #%L
* EUGene :: EUGene
*
* $Id: WriterReport.java 1079 2011-06-28 09:15:23Z tchemit $
* $HeadURL: https://svn.nuiton.org/eugene/tags/eugene-2.11/eugene/src/main/java/org/nuiton/eugene/writer/WriterReport.java $
* %%
* Copyright (C) 2004 - 2010 CodeLutin
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* .
* #L%
*/
package org.nuiton.eugene.writer;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
/**
* A class to save generated files in {@link ChainedFileWriter}.
*
* @author tchemit
* @since 2.0.2
*/
public class WriterReport {
protected Map> datas;
public Map> getDatas() {
if (datas == null) {
datas = new TreeMap>();
}
return datas;
}
public void addFile(String entry, File file, boolean verbose) {
List files = getDatas().get(entry);
if (files == null) {
files = new ArrayList();
getDatas().put(entry, files);
}
files.add(file);
}
public int getFilesCount() {
int tot = 0;
for (List files : getDatas().values()) {
tot += files.size();
}
return tot;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy