package siprp.higiene.relatorio.print;

import java.util.Vector;

import org.jdom.Element;

public class AreaToPrint
	implements PrintableInterface
{
	protected String designacao;
	protected Vector<PostoToPrint> postos;
	
	public AreaToPrint( String designacao, Vector<PostoToPrint> postos )
	{
		super();
		this.designacao = designacao;
		this.postos = postos;
	}

	@Override
	public Element toJdomElement() throws Exception
	{
		Element areaElement = new Element( "area" );
		Element designacaoElement = new Element( "designacao" );
		designacaoElement.setText( designacao );
		areaElement.addContent( designacaoElement );
		for( PostoToPrint posto : postos )
		{
			areaElement.addContent( posto.toJdomElement() );
		}
		return areaElement;
	}

}
