/*
 * $Id: VKCCountCatDocs.java,v 1.6 2006/05/09 15:27:38 marbobo Exp $
 *
 * Copyright (c) Siemens AG 2008 
 *           (c) Universität Paderborn 2008 
 * Licensed under EUPL 1.1. 
 *
 * $Log: VKCCountCatDocs.java,v $
 * Revision 1.6  2006/05/09 15:27:38  marbobo
 * + Refactoring
 *
 * Revision 1.5  2005/03/24 12:56:23  marbobo
 * + Größenanzeige für Dokumente und Kategorien auf 2 Dezimalstellen eingestellt
 *
 * Revision 1.4  2005/03/23 19:44:46  marbobo
 * + Lokalisierung der Größenanzeige
 *
 * Revision 1.3  2005/03/21 20:27:05  marbobo
 * + DocSize auf Type Long umgestellt
 *
 * Revision 1.2  2004/10/26 22:27:59  marbobo
 * + kleine Anpassung
 *
 * Revision 1.1  2004/07/20 15:19:11  jonyp
 * changed due to move of VKCQuotaInfo from util to view.bean
 *
 * Revision 1.8  2004/06/27 17:33:38  marbobo
 * + Quellcode maintenance
 *
 * Revision 1.7  2004/06/04 09:22:11  jonyp
 * format things
 *
 * Revision 1.6  2004/03/09 18:40:38  bigmac
 * Anpassungen an VKCSysParameterSerializer
 *
 * Revision 1.5  2003/11/28 15:04:58  jonyp
 * changes due to new schema
 *
 * Revision 1.4  2003/09/04 17:04:49  marbobo
 * ungenutzte Imports entfernt
 *
 * Revision 1.3  2003/09/01 15:09:03  marbobo
 * Es werden nun auch Dokumentanzahl der Subkategorien mit gespeichert
 *
 * Revision 1.2  2003/08/31 20:12:31  marbobo
 * Serializierung
 *
 * Revision 1.1  2003/08/30 11:41:51  jonyp
 * initial version
 *
 *
 */
package vkc.view.bean;

import java.io.Serializable;
import java.util.HashMap;

import vkc.util.VKCStringUtils;

public class VKCCountCatDocs implements Serializable {
	private int categoryId = 0;
	private int countCats = 0;
	private int countDocs = 0;

	private long amountDocs = 0; // amount of bytes of all docs published
	private long amountAddDocs = 0; // amount of bytes of all additional document formats 

	private HashMap subCatDocs = new HashMap();

	public VKCCountCatDocs() {
	}

	public VKCCountCatDocs(int categoryId, int countSubCats, int countDocs) {
		this.categoryId = categoryId;
		this.countCats = countSubCats;
		this.countDocs = countDocs;
	}

	public VKCCountCatDocs(int countCats, int countDocs) {
		this.countCats = countCats;
		this.countDocs = countDocs;
	}

	public int getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(int categoryId) {
		this.categoryId = categoryId;
	}

	public int getCountCats() {
		return countCats;
	}

	public void setCountCats(int countCats) {
		this.countCats = countCats;
	}

	public long getAmountAddDocs() {
		return amountAddDocs;
	}

	public long getSumAmountDocs() {
		return getAmountAddDocs() + getAmountDocs();
	}

	public void setAmountAddDocs(long amountAddDocs) {
		this.amountAddDocs = amountAddDocs;
	}

	public long getAmountDocs() {
		return amountDocs;
	}

	public void setAmountDocs(long amountDocs) {
		this.amountDocs = amountDocs;
	}

	public String getFormattedAmountDocs(String languageId) {
		return VKCStringUtils.formatBytes(getAmountDocs(), languageId);
	}

	public int getCountDocs() {
		return this.countDocs;
	}

	public void setCountDocs(int countDocs) {
		this.countDocs = countDocs;
	}

	public HashMap getSubCatDocs() {
		return subCatDocs;
	}

	public void setSubCatDocs(HashMap set) {
		subCatDocs = set;
	}

	public void addCountSubCatDoc(VKCCountCatDocs countCatDoc) {
		if (!this.subCatDocs.containsKey(new Integer(countCatDoc.getCategoryId()))) {
			this.subCatDocs.put(new Integer(countCatDoc.getCategoryId()), countCatDoc);
		}
	}
}