// Path: src/main/java/org/deri/cqels/data/Mapping.java
// public interface Mapping extends Map<Var, Long>{
// 	
// 
// 	public long get(Var var); 
// 	
// 	public void from(OpRouter router);
// 	
// 	public OpRouter from();
// 	
// 	public ExecContext getCtx();
// 	
// 	public Iterator<Var> vars();
// 	
// 	public void addParent(Mapping parent);
// 	
// 	public boolean hasParent();
// 	
// 	public boolean isCompatible(Mapping mapping);
// }
// 
// Path: src/main/java/org/deri/cqels/engine/iterator/MappingIterator.java
// public interface MappingIterator extends Closeable, Iterator<Mapping> {
// 
//     /**
//      * Get next binding
//      */
//     public Mapping nextMapping();
// 
//     /**
//      * Cancels the query as soon as is possible for the given iterator
//      */
//     public void cancel();
// }


import org.deri.cqels.data.Mapping;
import org.deri.cqels.engine.iterator.MappingIterator;
import com.hp.hpl.jena.sparql.algebra.Op;
package org.deri.cqels.engine;


/**
 *This interface contains the behaviours of a router which is responsible to receive a mapping and route it
 *to the higher node in the router-node tree 
 * @author		Danh Le Phuoc
 * @author 		Chan Le Van
 * @organization DERI Galway, NUIG, Ireland  www.deri.ie
 * @email 	danh.lephuoc@deri.org
 * @email   chan.levan@deri.org
 */
public interface OpRouter {
	/**
	 * Each specific router contains an operator what is parsed from the query
	 * This method will get that op out 
	 */
	public Op getOp();
	/**
	 * Each specific router contains a data buffer in the form of mappings
	 * This method will get that data buffer out
	 */
	public MappingIterator getBuff();
	/**
	 * This method tries to search in the data mapping buffer whether there is any
	 * mapping that matches the specified mapping. 
	 * @param mapping the specified mapping
	 * @return a mapping iterator of matched mappings in buffer
	 */
// Path: src/main/java/org/deri/cqels/data/Mapping.java
// public interface Mapping extends Map<Var, Long>{
// 	
// 
// 	public long get(Var var); 
// 	
// 	public void from(OpRouter router);
// 	
// 	public OpRouter from();
// 	
// 	public ExecContext getCtx();
// 	
// 	public Iterator<Var> vars();
// 	
// 	public void addParent(Mapping parent);
// 	
// 	public boolean hasParent();
// 	
// 	public boolean isCompatible(Mapping mapping);
// }
// 
// Path: src/main/java/org/deri/cqels/engine/iterator/MappingIterator.java
// public interface MappingIterator extends Closeable, Iterator<Mapping> {
// 
//     /**
//      * Get next binding
//      */
//     public Mapping nextMapping();
// 
//     /**
//      * Cancels the query as soon as is possible for the given iterator
//      */
//     public void cancel();
// }


// Path: src/main/java/org/deri/cqels/engine/OpRouter.java
import org.deri.cqels.data.Mapping;
import org.deri.cqels.engine.iterator.MappingIterator;
import com.hp.hpl.jena.sparql.algebra.Op;

package org.deri.cqels.engine;


/**
 *This interface contains the behaviours of a router which is responsible to receive a mapping and route it
 *to the higher node in the router-node tree 
 * @author		Danh Le Phuoc
 * @author 		Chan Le Van
 * @organization DERI Galway, NUIG, Ireland  www.deri.ie
 * @email 	danh.lephuoc@deri.org
 * @email   chan.levan@deri.org
 */
public interface OpRouter {
	/**
	 * Each specific router contains an operator what is parsed from the query
	 * This method will get that op out 
	 */
	public Op getOp();
	/**
	 * Each specific router contains a data buffer in the form of mappings
	 * This method will get that data buffer out
	 */
	public MappingIterator getBuff();
	/**
	 * This method tries to search in the data mapping buffer whether there is any
	 * mapping that matches the specified mapping. 
	 * @param mapping the specified mapping
	 * @return a mapping iterator of matched mappings in buffer
	 */
	public MappingIterator searchBuff4Match(Mapping mapping);