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

SizeTerm

public final class SizeTerm extends IntegerComparisonTerm
This class implements comparisons for Message sizes.
author
Bill Shannon
author
John Mani

Fields Summary
private static final long
serialVersionUID
Constructors Summary
public SizeTerm(int comparison, int size)
Constructor.

param
comparison the Comparison type
param
size the size


       	    		      
         
	super(comparison, size);
    
Methods Summary
public booleanequals(java.lang.Object obj)
Equality comparison.

	if (!(obj instanceof SizeTerm))
	    return false;
	return super.equals(obj);
    
public booleanmatch(javax.mail.Message msg)
The match method.

param
msg the size comparator is applied to this Message's size
return
true if the size is equal, otherwise false

	int size;

	try {
	    size = msg.getSize();
	} catch (Exception e) {
	    return false;
	}

	if (size == -1)
	    return false;

	return super.match(size);