javax.mail.search

Class DateTerm

Implemented Interfaces:
Serializable
Known Direct Subclasses:
ReceivedDateTerm, SentDateTerm

public abstract class DateTerm
extends ComparisonTerm

This class implements comparisons for Dates.

Field Summary

protected Date
date
The date.

Fields inherited from class javax.mail.search.ComparisonTerm

EQ, GE, GT, LE, LT, NE, comparison

Constructor Summary

DateTerm(int comparison, Date date)
Constructor.

Method Summary

boolean
equals(Object other)
Equality comparison.
int
getComparison()
Return the type of comparison.
Date
getDate()
Return the Date to compare with.
int
hashCode()
Compute a hashCode for this object.
protected boolean
match(Date d)
The date comparison method.

Methods inherited from class javax.mail.search.ComparisonTerm

equals, hashCode

Methods inherited from class javax.mail.search.SearchTerm

match

Field Details

date

protected Date date
The date.

Constructor Details

DateTerm

protected DateTerm(int comparison,
                   Date date)
Constructor.

Parameters:
comparison - the comparison type

Method Details

equals

public boolean equals(Object other)
Equality comparison.
Overrides:
equals in interface ComparisonTerm


getComparison

public int getComparison()
Return the type of comparison.


getDate

public Date getDate()
Return the Date to compare with.


hashCode

public int hashCode()
Compute a hashCode for this object.
Overrides:
hashCode in interface ComparisonTerm


match

protected boolean match(Date d)
The date comparison method.

Parameters:
d - the date in the constructor is compared with this date

Returns:
true if the dates match, otherwise false