package com.jxml.quick.qmap;
import java.util.*;

/**
 * Returns false if any qualifier in the list returns false.
 */
public class QQualifierItemIndex implements QQualifier
{
	public int ndx1;
	public int ndx2;
	public int ndx3;
	
	public QQualifierItemIndex(){}

	public QQualifierItemIndex(int ndx1, int ndx2, int ndx3)
	{
		this.ndx1=ndx1;
		this.ndx2=ndx2;
		this.ndx3=ndx3;
	}

	public boolean acceptable(QIndexedComparableList icl)
	{
                
		int count=((Integer)icl.keyList.get(ndx1)).intValue();
		int limit=((Integer)icl.keyList.get(ndx2)).intValue();
		int dif=limit-count;
		return ndx3<=dif;
	}
}