// Path: big-data-java/src/easy/data/field/IDataField.java
// public interface IDataField {
// 	public String getDescription();
// 	public <T> T apply(IDFVisitor<T> fv);
// }


import java.util.ArrayList;
import java.util.List;
import easy.data.field.IDataField;
package easy.data;



/**
 * Represents a data source
 * 
 * @author Nadeem Abdul Hamid
 *
 */
public interface IDataSource {
	
	/**
	 * Produce the name of this data source
	 * @return the name of this data source
	 */
	public String getName();
	
	/**
	 * Produce a description of this data source
	 * @return a description of this data source
	 */
	public String getDescription();
	
	/**
	 * Produce a URL to more information about this data source
	 * @return a URL to more information about this data source
	 */
	public String getInfoURL();
			
	/**
	 * Determines whether all required parameters have been supplied for this data source 
	 * @return whether all required parameters have been supplied for this data source 
	 */
	public boolean readyToLoad();
	
	/**
	 * Produces a list of keys of required parameters that have not
	 * been supplied yet
	 * @return a list of parameter keys
	 */
	public List<String> missingParams();
	
	/**
	 * Determines whether data has been successfully loaded and parsed from the data source 
	 * @return whether data has been successfully loaded and parsed from the data source 
	 */
	public boolean hasData();
	
	/**
	 * Determines whether data has been successfully loaded and parsed from the data source
	 * (i.e. it calls hasData()), 
	 * and whether data elements with the given keys (field labels) are available
	 * in this data source. 
	 */
	public boolean hasFields(String... keys);
	
	/**
	 * Registers a request parameter with this data source
	 * @param param the parameter specification
	 * @return this updated data source
	 */
	public IDataSource addParam(IParam param);
	
	/** 
	 * Sets a value for a parameter (either query or path)
	 * @param op key for the parameter
	 * @param val value for the parameter
	 * @return this updated data source
	 */
	public IDataSource set(String op, String val);
	
	/**
	 * Sets the cache timeout value, in <em>minutes</em>. This should be called before load() to have effect.
	 */
	public IDataSource setCacheTimeout(int val);
	public IDataSource setCacheDirectory(String path);

	/**
	 * Sets an internal option for the data source
	 * @return this updated data source
	 */
	public IDataSource setOption(String op, String val);
	
	/**
	 * Sets the data structure specification for extracting
	 * data from this source
	 */
// 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/IDataSource.java
import java.util.ArrayList;
import java.util.List;
import easy.data.field.IDataField;

package easy.data;



/**
 * Represents a data source
 * 
 * @author Nadeem Abdul Hamid
 *
 */
public interface IDataSource {
	
	/**
	 * Produce the name of this data source
	 * @return the name of this data source
	 */
	public String getName();
	
	/**
	 * Produce a description of this data source
	 * @return a description of this data source
	 */
	public String getDescription();
	
	/**
	 * Produce a URL to more information about this data source
	 * @return a URL to more information about this data source
	 */
	public String getInfoURL();
			
	/**
	 * Determines whether all required parameters have been supplied for this data source 
	 * @return whether all required parameters have been supplied for this data source 
	 */
	public boolean readyToLoad();
	
	/**
	 * Produces a list of keys of required parameters that have not
	 * been supplied yet
	 * @return a list of parameter keys
	 */
	public List<String> missingParams();
	
	/**
	 * Determines whether data has been successfully loaded and parsed from the data source 
	 * @return whether data has been successfully loaded and parsed from the data source 
	 */
	public boolean hasData();
	
	/**
	 * Determines whether data has been successfully loaded and parsed from the data source
	 * (i.e. it calls hasData()), 
	 * and whether data elements with the given keys (field labels) are available
	 * in this data source. 
	 */
	public boolean hasFields(String... keys);
	
	/**
	 * Registers a request parameter with this data source
	 * @param param the parameter specification
	 * @return this updated data source
	 */
	public IDataSource addParam(IParam param);
	
	/** 
	 * Sets a value for a parameter (either query or path)
	 * @param op key for the parameter
	 * @param val value for the parameter
	 * @return this updated data source
	 */
	public IDataSource set(String op, String val);
	
	/**
	 * Sets the cache timeout value, in <em>minutes</em>. This should be called before load() to have effect.
	 */
	public IDataSource setCacheTimeout(int val);
	public IDataSource setCacheDirectory(String path);

	/**
	 * Sets an internal option for the data source
	 * @return this updated data source
	 */
	public IDataSource setOption(String op, String val);
	
	/**
	 * Sets the data structure specification for extracting
	 * data from this source
	 */
	public IDataSource setFieldSpec(IDataField spec);