/* $Id: SpreadSelectionList.java 125 2011-03-09 09:49:51Z ohura $ */
package smart_gs.logical;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

public class SpreadSelectionList {
	String SpreadSelectionListName;
	String SpreadSelectionListSpec;
	
	public SpreadSelectionList (String name, String list) {
		this.SpreadSelectionListName = name;
		this.SpreadSelectionListSpec = list;
	}
	
	public String getName() {
		return this.SpreadSelectionListName;
	}
	public void setName(String name) {
		this.SpreadSelectionListName = name;
	}
	public String getSpreadSelectionListSpec() {
		return this.SpreadSelectionListSpec;
	}
	public void setSpreadSelectionListSpec(String SpreadSelectionListSpec) {
		this.SpreadSelectionListSpec = SpreadSelectionListSpec;
	}
	public String toString() {
		return "[" + getName() + "; " + getSpreadSelectionListSpec() + "]";
	}
	
	
//	TODO Added by shayashi 20101031
//	This is implemented without using CreateXMLElementVisitor, since
//	SpreadSelectionList is not regarded as a GSResource, since it does
//	not have URI. Or is it better to assign it an URI?
	public Node createXMLElement(Document document) {
		Element element = document.createElement("spreadSelectionList");
		element.setAttribute("name", this.getName());
		element.setAttribute("spec", this.getSpreadSelectionListSpec());
		return element;
	}
}
