/*
 * Copyright (C) 1999-2006 <a href="mailto:paschke@in.tum.de">Adrian Paschke</a>
 * 
 * The Regression Test is part of the Rule Based Service Level Agreement (RBSLA)
 * framework, available at 
 * <a href=" http://ibis.in.tum.de/staff/paschke/rbsla/index.htm">RBSLA</a>
 * 
 * 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 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
 */

package rbsla.rmltoprova;

import org.jdom.*;
import java.util.*;

/**
 * Analysis
 * 
 * Implements the transaltion of RuleML 0.86 and RBSLA 0.01 into Prova syntax
 * 
 * @author <A HREF="mailto:adrian.paschke@gmx.de">Adrian Paschke</A>
 * @version 0.1 <1 Feb 2005>
 * @since 0.1
 * @deprecated Since RuleML 0.87 and RBSLA 0.1 XSLT Stylesheets are provided for translation
 */
public class Analysis {
	private List RuleElements;
	private List DefeasibleRuleElements;
	private List FactElements;
	private List QueryElements;
	private List ECAElements;

	private RuleBase rb;

	private Element sbc;
	private Namespace ns;

	public Analysis(Element _sbc) {
		
		sbc = _sbc;	
		ns=sbc.getNamespace();		
		ECAElements = sbc.getChildren("ECA",ns);		
		RuleElements = sbc.getChildren("imp",ns);			
		DefeasibleRuleElements = sbc.getChildren("defeasible",ns);
		FactElements = sbc.getChildren("fact",ns);
		QueryElements = sbc.getChildren("query",ns);		
		rb = new RuleBase(ECAElements,RuleElements,FactElements,DefeasibleRuleElements,QueryElements);
	}

	public String toString() {		
		return rb.toString();
	}

	public List listAllECARules() {
		return rb.listECARules();
	}
	
	public List listAllDefeasibleRules() {
		return rb.listDefeasibleRules();
	}
	
	
	public List listAllRules() {
		return rb.listRules();
	}
	
	public List listAllFacts() {
		return rb.listFacts();
	}
	
	public List listAllQueries() {
		return rb.listQueries();
	}
}