FileDocCategorySizeDatePackage
IntegerComparisonTerm.javaAPI DocGlassfish v2 API3418Mon May 14 15:28:50 BST 2007javax.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;
	}