All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.anotheria.anodoc.query2.QueryModProperty Maven / Gradle / Ivy

package net.anotheria.anodoc.query2;


/**
 * 
 * IMPORTANT:Tested only in postgressql!
 * 
 * @author denis
 *
 */
public class QueryModProperty extends QueryProperty{
	
	private long mod;
	
	public  QueryModProperty(String aName, long aMod, long aValue){
		super(aName, aValue);
		mod = aMod;
		
	}

	@Override
	public boolean doesMatch(Object o) {
		return o == null ?getOriginalValue() == null :
			((Long)o) % mod == (Long)getValue();
	}

	@Override
	public String getComparator() {
		return " %  " + mod + " = ";
	}
	
	@Override
	public boolean unprepaireable() {
		return false;
	}

	public long getMod() {
		return mod;
	}

	public void setMod(long mod) {
		this.mod = mod;
	}
	
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy