com.openexchange.mail.search
Class SentDateTerm

java.lang.Object
  extended by com.openexchange.mail.search.SearchTerm<ComparablePattern<java.util.Date>>
      extended by com.openexchange.mail.search.SentDateTerm
All Implemented Interfaces:
java.io.Serializable

public final class SentDateTerm
extends SearchTerm<ComparablePattern<java.util.Date>>

SentDateTerm

Author:
Thorben Betten
See Also:
Serialized Form

Constructor Summary
SentDateTerm(ComparisonType comparisonType, java.util.Date sentDate)
          Initializes a new SentDateTerm
 
Method Summary
 void addMailField(java.util.Collection<MailField> col)
          Adds the addressed MailField to specified collection
 javax.mail.search.SearchTerm getJavaMailSearchTerm()
          Generates the corresponding JavaMail instance of SearchTerm from this search term
 javax.mail.search.SearchTerm getNonWildcardJavaMailSearchTerm()
          Generates the corresponding instance of SearchTerm from this search term without any wildcard characters.
 ComparablePattern<java.util.Date> getPattern()
          Gets the pattern to which the expression should match.
 boolean matches(MailMessage mailMessage)
          Checks if specified mail message matches this search term
 boolean matches(javax.mail.Message msg)
          Checks if given message matches this search term
 
Methods inherited from class com.openexchange.mail.search.SearchTerm
containsWildcard, filter, filter, isAscii
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SentDateTerm

public SentDateTerm(ComparisonType comparisonType,
                    java.util.Date sentDate)
Initializes a new SentDateTerm

Method Detail

getPattern

public ComparablePattern<java.util.Date> getPattern()
Description copied from class: SearchTerm
Gets the pattern to which the expression should match.

Specified by:
getPattern in class SearchTerm<ComparablePattern<java.util.Date>>
Returns:
The sent date to match

addMailField

public void addMailField(java.util.Collection<MailField> col)
Description copied from class: SearchTerm
Adds the addressed MailField to specified collection

Specified by:
addMailField in class SearchTerm<ComparablePattern<java.util.Date>>
Parameters:
col - The collection which gathers addressed fields

matches

public boolean matches(MailMessage mailMessage)
Description copied from class: SearchTerm
Checks if specified mail message matches this search term

Specified by:
matches in class SearchTerm<ComparablePattern<java.util.Date>>
Parameters:
mailMessage - The mail message to check
Returns:
true if specified mail message matches this search term; otherwise false

matches

public boolean matches(javax.mail.Message msg)
                throws MailException
Description copied from class: SearchTerm
Checks if given message matches this search term

Specified by:
matches in class SearchTerm<ComparablePattern<java.util.Date>>
Parameters:
msg - The message to check
Returns:
true if message matches this search term; otherwise false
Throws:
MailException - If check fails

getJavaMailSearchTerm

public javax.mail.search.SearchTerm getJavaMailSearchTerm()
Description copied from class: SearchTerm
Generates the corresponding JavaMail instance of SearchTerm from this search term

Specified by:
getJavaMailSearchTerm in class SearchTerm<ComparablePattern<java.util.Date>>
Returns:
The corresponding instance of SearchTerm

getNonWildcardJavaMailSearchTerm

public javax.mail.search.SearchTerm getNonWildcardJavaMailSearchTerm()
Description copied from class: SearchTerm
Generates the corresponding instance of SearchTerm from this search term without any wildcard characters.

This is useful to preselect possible positives and to manually filtering out false positives.

Specified by:
getNonWildcardJavaMailSearchTerm in class SearchTerm<ComparablePattern<java.util.Date>>
Returns:
The corresponding instance of SearchTerm without any wildcard characters.
See Also:
SearchTerm.containsWildcard()