/*
 * $Id: VKCDocumentStatistics.java,v 1.1 2004/07/06 14:39:26 jonyp Exp $
 *
 * Copyright (c) Siemens AG 2008 
 *           (c) Universität Paderborn 2008 
 * Licensed under EUPL 1.1. 
 *
 * $Log: VKCDocumentStatistics.java,v $
 * Revision 1.1  2004/07/06 14:39:26  jonyp
 * preliminary
 *
 */

package vkc.statistics;

import java.text.DecimalFormat;
import java.util.GregorianCalendar;

public class VKCDocumentStatistics 
{
	private int countDocs = 0;
	private int countAddDocs = 0;
	private int countAuthorsOfDocs = 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 int countExpiredDocs = 0;
	private long amountExpiredDocs = 0;
	private int countAuthorsOfExpiredDocs = 0;
	private GregorianCalendar from;
	private GregorianCalendar until;
	
	// wie oft und von wieviel benutzern wurden die dokumente aufgerufen (lastaccessed)      
    
	public VKCDocumentStatistics() {
	}   

	private String getFormattedAmountInMB(long amount) {
		double oneMB = 1024 * 1024;
		DecimalFormat formatter = new DecimalFormat(); 
		formatter.setMaximumFractionDigits( 3 );
		return formatter.format( amount/oneMB );
	}

    public String getFormattedAmountDocsInMB() {
    	return getFormattedAmountInMB(this.amountDocs);
    }

	public String getFormattedAmountAddDocsInMB() {
		return getFormattedAmountInMB(this.amountAddDocs);
	}

	public long getAmountAddDocs() {
		return amountAddDocs;
	}

	public long getAmountDocs() {
		return amountDocs;
	}

	public int getCountAuthorsOfDocs() {
		return countAuthorsOfDocs;
	}

	public int getCountDocs() {
		return countDocs;
	}

	public GregorianCalendar getFrom() {
		return from;
	}

	public GregorianCalendar getUntil() {
		return until;
	}

	public void setAmountAddDocs(long l) {
		amountAddDocs = l;
	}

	public void setAmountDocs(long l) {
		amountDocs = l;
	}

	public void setCountAuthorsOfDocs(int i) {
		countAuthorsOfDocs = i;
	}

	public void setCountDocs(int i) {
		countDocs = i;
	}

	public void setFrom(GregorianCalendar timestamp) {
		from = timestamp;
	}

	public void setUntil(GregorianCalendar timestamp) {
		until = timestamp;
	}
	
	public int getCountExpiredDocs() {
		return countExpiredDocs;
	}

	public void setCountExpiredDocs(int i) {
		countExpiredDocs = i;
	}

	public long getAmountExpiredDocs() {
		return amountExpiredDocs;
	}

	public void setAmountExpiredDocs(long l) {
		amountExpiredDocs = l;
	}

	public int getCountAuthorsOfExpiredDocs() {
		return countAuthorsOfExpiredDocs;
	}

	public void setCountAuthorsOfExpiredDocs(int i) {
		countAuthorsOfExpiredDocs = i;
	}

	public int getCountAddDocs() {
		return countAddDocs;
	}

	public void setCountAddDocs(int i) {
		countAddDocs = i;
	}

}
