1 21 22 27 28 package javax.mail.search; 29 30 import javax.mail.Message ; 31 32 38 public final class SizeTerm extends IntegerComparisonTerm { 39 40 private static final long serialVersionUID = -2556219451005103709L; 41 42 48 public SizeTerm(int comparison, int size) { 49 super(comparison, size); 50 } 51 52 58 public boolean match(Message msg) { 59 int size; 60 61 try { 62 size = msg.getSize(); 63 } catch (Exception e) { 64 return false; 65 } 66 67 if (size == -1) 68 return false; 69 70 return super.match(size); 71 } 72 73 76 public boolean equals(Object obj) { 77 if (!(obj instanceof SizeTerm )) 78 return false; 79 return super.equals(obj); 80 } 81 } 82 | Popular Tags |