FileDocCategorySizeDatePackage
IntegerComparisonTerm.javaAPI DocJavaMail 1.4.33363Tue Nov 17 10:38:12 GMT 2009javax.mail.search

IntegerComparisonTerm

public abstract class IntegerComparisonTerm extends ComparisonTerm
This class implements comparisons for integers.
author
Bill Shannon
author
John Mani

Fields Summary
protected int
number
The number.
private static final long
serialVersionUID
Constructors Summary
protected IntegerComparisonTerm(int comparison, int number)


         
	this.comparison = comparison;
	this.number = number;
    
Methods Summary
public booleanequals(java.lang.Object obj)
Equality comparison.

	if (!(obj instanceof IntegerComparisonTerm))
	    return false;
	IntegerComparisonTerm ict = (IntegerComparisonTerm)obj;
	return ict.number == this.number && super.equals(obj);
    
public intgetComparison()
Return the type of comparison.

	return comparison;
    
public intgetNumber()
Return the number to compare with.

	return number;
    
public inthashCode()
Compute a hashCode for this object.

	return number + super.hashCode();
    
protected booleanmatch(int i)

	switch (comparison) {
	    case LE: 
		return i <= number;
	    case LT:
		return i < number;
	    case EQ:
		return i == number;
	    case NE:
		return i != number;
	    case GT:
		return i > number;
	    case GE:
		return i >= number;
	    default:
		return false;
	}