/* $Id: SpecLayoutList.java,v 1.2 2006/06/04 08:33:45 erk Exp $
 * -----------------------------------------------------------------------
 * 
 * TSP Library - core components for a generic Transport Sampling Protocol.
 * 
 * Copyright (c) 2002 Yves DUFRENNE, Stephane GALLES, Eric NOULARD and Robert PAGNOT 
 * 
 * This library 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 2.1 of the License, or (at your option) any later version.
 * This library 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
 * Lesser General Public License for more details.
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 * 
 * -----------------------------------------------------------------------
 * 
 * Project    : TSP
 * SubProject : jTSP
 * Maintainer : tsp@astrium-space.com
 * Component  : 
 * 
 * -----------------------------------------------------------------------
 * 
 * Purpose   : Consumer
 * 
 * -----------------------------------------------------------------------
 */


package tsp.consumer.util.configuration;



import java.util.LinkedList;
import java.util.List;

import tsp.util.ToStringHelper;

public class SpecLayoutList implements Consolidatable {

	private String description;
    private LinkedList layouts = new LinkedList(); // Consumer Specific Layout, etc...

    private final SpecSamplingConfig root;

    public SpecLayoutList(final SpecSamplingConfig root) {
		super();
		this.root = root;
	}

    public String getDescription() {
        return description;
    }
    
    public void setDescription(String description){
    	this.description = description;
    }
    
    public List getLayoutList() {
        return layouts;
    }
    
    public SpecLayout getLastLayout(){
        return (SpecLayout)layouts.getLast();
    }
    
    public void addLastLayout(SpecLayout l){
    	l.setLayoutList(this);
    }
         
    public String toString(){
        return ToStringHelper.toString(this);
    }
	
	public void consolidate() throws SpecException {
		ConsolidatorHelper.Consolidate(layouts);
	}
    

}
