// Path: big-data-java/src/easy/data/field/CompField.java
// public class CompField extends ADataField implements IDataField {
// 	private HashMap<String, IDataField> fieldMap;
// 
// 	public CompField() {
// 		this(null);
// 	}
// 
// 	public CompField(String basePath) {
// 		this(basePath, null);
// 	}
// 
// 	public CompField(String basePath, String description) {
// 		super(basePath, description);
// 		this.fieldMap = new HashMap<String, IDataField>();
// 	}
// 
// 	public IDataField addField(String name, IDataField fld) {
// 		return fieldMap.put(name, fld);
// 	}
// 	
// 	public String[] fieldNames() {
// 		return fieldMap.keySet().toArray(new String[] {});
// 	}
// 	
// 	public Collection<IDataField> fields() {
// 		return fieldMap.values();
// 	}
// 	
// 	public IDataField getField(String name) {
// 		return fieldMap.get(name);
// 	}
// 	
// 	public boolean hasField(String name) {
// 		return fieldMap.containsKey(name);
// 	}
// 
// 	public <T> T apply(IDFVisitor<T> fv) {
// 		return fv.visitCompField(this, this.basePath, this.description, this.fieldMap);
// 	}
// 
// 	public String toString() {
// 		String m = "{_<" + basePath + "> ";
// 		boolean firstDone = false;
// 		for (String k : fieldNames()) {
// 			if (firstDone) { m += ", "; } else { firstDone = true; }
// 			m += (k + ": " + fieldMap.get(k));
// 		}
// 		m += "}";
// 		return m;
// 	}
// 
// }
// 
// Path: big-data-java/src/easy/data/field/IDataField.java
// public interface IDataField {
// 	public String getDescription();
// 	public <T> T apply(IDFVisitor<T> fv);
// }
// 
// Path: big-data-java/src/easy/data/field/ListField.java
// public class ListField extends ADataField implements IDataField {
// 	private String elemPath;
// 	private IDataField elemField;
// 
// 	public ListField(String basepath, String elempath, IDataField basefld) {
// 		this(basepath, elempath, basefld, null);
// 	}
// 	
// 	public ListField(String basepath, String elemPath, IDataField elemField, String description) {
// 		super(basepath, description);
// 		this.elemPath = elemPath;
// 		this.elemField = elemField;
// 	}
// 	
// 	public String getElemPath() {
// 		return this.elemPath;
// 	}
// 	
// 	public IDataField getElemField() {
// 		return this.elemField;
// 	}
// 
// 	public <T> T apply(IDFVisitor<T> fv) {
// 		return fv.visitListField(this, this.basePath, this.description, this.elemPath, this.elemField);
// 	}
// 
// 	public String toString() {
// 		return "[_<" + basePath + "," + elemPath + "> " + elemField + "]";
// 	}
// 
// }
// 
// Path: big-data-java/src/easy/data/field/PrimField.java
// public class PrimField extends ADataField implements IDataField {
// 	public PrimField() {
// 		super(null, null);
// 	}
// 	
// 	public PrimField(String path) {
// 		super(path, null);
// 	}
// 	
// 	public PrimField(String path, String description) {
// 		super(path, description);
// 	}
// 	
// 	public <T> T apply(IDFVisitor<T> fv) {
// 		return fv.visitPrimField(this, this.basePath, this.description);
// 	}
// 
// 	public String toString() {
// 		return "<" + basePath + ">";
// 	}
// }


import static org.junit.Assert.*;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import easy.data.field.CompField;
import easy.data.field.IDataField;
import easy.data.field.ListField;
import easy.data.field.PrimField;
import easy.data.sig.*;
import easy.data.util.*;
import easy.data.xml.*;
import java.util.*;
	public static void tearDownAfterClass() throws Exception {
	}

	@Before
	public void setUp() throws Exception {
		xml1 = IOUtil.loadXML("src/big/data/tests/dsspec1.xml");
		pf1 = new PrimField("name", "option name");
		pf2 = new PrimField("value", "option setting");
		pf3 = new PrimField(null);
		pf4 = new PrimField("dataspec/compfield/fields/field/name");
		cf1 = new CompField(null, "an option setting pair");
		cf2 = new CompField("options/option", "an option setting pair");
		lf1 = new ListField("options", "option", cf1, "list of option settings");
		lf2 = new ListField("blah", "blup", pf3, "messed up");
		lf3 = new ListField(null, "dataspec/compfield/fields/field/name", pf3, "top level field names");
		
		cf1.addField("value", pf2);
		cf1.addField("name", pf1);
		cf2.addField("value", pf2);
		cf2.addField("name", pf1);
		
		cspair = new CompSig<Pair>(Pair.class);
		cspair.addField(PrimSig.STRING_SIG, "name");
		cspair.addField(PrimSig.STRING_SIG, "value");
	}

	@After
	public void tearDown() throws Exception {
	}

// Path: big-data-java/src/easy/data/field/CompField.java
// public class CompField extends ADataField implements IDataField {
// 	private HashMap<String, IDataField> fieldMap;
// 
// 	public CompField() {
// 		this(null);
// 	}
// 
// 	public CompField(String basePath) {
// 		this(basePath, null);
// 	}
// 
// 	public CompField(String basePath, String description) {
// 		super(basePath, description);
// 		this.fieldMap = new HashMap<String, IDataField>();
// 	}
// 
// 	public IDataField addField(String name, IDataField fld) {
// 		return fieldMap.put(name, fld);
// 	}
// 	
// 	public String[] fieldNames() {
// 		return fieldMap.keySet().toArray(new String[] {});
// 	}
// 	
// 	public Collection<IDataField> fields() {
// 		return fieldMap.values();
// 	}
// 	
// 	public IDataField getField(String name) {
// 		return fieldMap.get(name);
// 	}
// 	
// 	public boolean hasField(String name) {
// 		return fieldMap.containsKey(name);
// 	}
// 
// 	public <T> T apply(IDFVisitor<T> fv) {
// 		return fv.visitCompField(this, this.basePath, this.description, this.fieldMap);
// 	}
// 
// 	public String toString() {
// 		String m = "{_<" + basePath + "> ";
// 		boolean firstDone = false;
// 		for (String k : fieldNames()) {
// 			if (firstDone) { m += ", "; } else { firstDone = true; }
// 			m += (k + ": " + fieldMap.get(k));
// 		}
// 		m += "}";
// 		return m;
// 	}
// 
// }
// 
// Path: big-data-java/src/easy/data/field/IDataField.java
// public interface IDataField {
// 	public String getDescription();
// 	public <T> T apply(IDFVisitor<T> fv);
// }
// 
// Path: big-data-java/src/easy/data/field/ListField.java
// public class ListField extends ADataField implements IDataField {
// 	private String elemPath;
// 	private IDataField elemField;
// 
// 	public ListField(String basepath, String elempath, IDataField basefld) {
// 		this(basepath, elempath, basefld, null);
// 	}
// 	
// 	public ListField(String basepath, String elemPath, IDataField elemField, String description) {
// 		super(basepath, description);
// 		this.elemPath = elemPath;
// 		this.elemField = elemField;
// 	}
// 	
// 	public String getElemPath() {
// 		return this.elemPath;
// 	}
// 	
// 	public IDataField getElemField() {
// 		return this.elemField;
// 	}
// 
// 	public <T> T apply(IDFVisitor<T> fv) {
// 		return fv.visitListField(this, this.basePath, this.description, this.elemPath, this.elemField);
// 	}
// 
// 	public String toString() {
// 		return "[_<" + basePath + "," + elemPath + "> " + elemField + "]";
// 	}
// 
// }
// 
// Path: big-data-java/src/easy/data/field/PrimField.java
// public class PrimField extends ADataField implements IDataField {
// 	public PrimField() {
// 		super(null, null);
// 	}
// 	
// 	public PrimField(String path) {
// 		super(path, null);
// 	}
// 	
// 	public PrimField(String path, String description) {
// 		super(path, description);
// 	}
// 	
// 	public <T> T apply(IDFVisitor<T> fv) {
// 		return fv.visitPrimField(this, this.basePath, this.description);
// 	}
// 
// 	public String toString() {
// 		return "<" + basePath + ">";
// 	}
// }


// Path: big-data-java/src/easy/data/tests/XMLInstantiatorTest.java
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import easy.data.field.CompField;
import easy.data.field.IDataField;
import easy.data.field.ListField;
import easy.data.field.PrimField;
import easy.data.sig.*;
import easy.data.util.*;
import easy.data.xml.*;
import java.util.*;

	public static void tearDownAfterClass() throws Exception {
	}

	@Before
	public void setUp() throws Exception {
		xml1 = IOUtil.loadXML("src/big/data/tests/dsspec1.xml");
		pf1 = new PrimField("name", "option name");
		pf2 = new PrimField("value", "option setting");
		pf3 = new PrimField(null);
		pf4 = new PrimField("dataspec/compfield/fields/field/name");
		cf1 = new CompField(null, "an option setting pair");
		cf2 = new CompField("options/option", "an option setting pair");
		lf1 = new ListField("options", "option", cf1, "list of option settings");
		lf2 = new ListField("blah", "blup", pf3, "messed up");
		lf3 = new ListField(null, "dataspec/compfield/fields/field/name", pf3, "top level field names");
		
		cf1.addField("value", pf2);
		cf1.addField("name", pf1);
		cf2.addField("value", pf2);
		cf2.addField("name", pf1);
		
		cspair = new CompSig<Pair>(Pair.class);
		cspair.addField(PrimSig.STRING_SIG, "name");
		cspair.addField(PrimSig.STRING_SIG, "value");
	}

	@After
	public void tearDown() throws Exception {
	}

	private static <T> T instantiate(IDataField f, XML xml, ISig s) {