FileDocCategorySizeDatePackage
SizeTerm.javaAPI DocGlassfish v2 API3035Mon May 14 15:28:50 BST 2007javax.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);