com.sun.mail.imap.protocol

## Class SearchSequence

- java.lang.Object
- - com.sun.mail.imap.protocol.SearchSequence

- Direct Known Subclasses:
    GmailSearchSequence

      public class SearchSequence
      extends Object

  This class traverses a search-tree and generates the corresponding IMAP search sequence. Each IMAPProtocol instance contains an instance of this class, which might be subclassed by subclasses of IMAPProtocol to add support for additional product-specific search terms.
  Author:
    John Mani

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Calendar` | `cal`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SearchSequence()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Argument` | `and(AndTerm term, String charset)`
    `protected Argument` | `body(BodyTerm term, String charset)`
    `protected Argument` | `flag(FlagTerm term)`
    `protected Argument` | `from(String address, String charset)`
    `Argument` | `generateSequence(SearchTerm term, String charset)` Generate the IMAP search sequence for the given search expression.
    `protected Argument` | `header(HeaderTerm term, String charset)`
    `static boolean` | `isAscii(SearchTerm term)` Check if the "text" terms in the given SearchTerm contain non US-ASCII characters.
    `static boolean` | `isAscii(SearchTerm[] terms)` Check if any of the "text" terms in the given SearchTerms contain non US-ASCII characters.
    `static boolean` | `isAscii(String s)` Does this string contain only ASCII characters?
    `protected Argument` | `messageid(MessageIDTerm term, String charset)`
    `protected Argument` | `modifiedSince(ModifiedSinceTerm term)` Generate argument for ModifiedSinceTerm.
    `protected Argument` | `not(NotTerm term, String charset)`
    `protected Argument` | `older(OlderTerm term)` Generate argument for OlderTerm.
    `protected Argument` | `or(OrTerm term, String charset)`
    `protected Argument` | `receiveddate(DateTerm term)`
    `protected Argument` | `recipient(Message.RecipientType type, String address, String charset)`
    `protected Argument` | `sentdate(DateTerm term)`
    `protected Argument` | `size(SizeTerm term)`
    `protected Argument` | `subject(SubjectTerm term, String charset)`
    `protected String` | `toIMAPDate(Date date)`
    `protected Argument` | `younger(YoungerTerm term)` Generate argument for YoungerTerm.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### cal

          protected Calendar cal

  - ### Constructor Detail

    - #### SearchSequence

          public SearchSequence()

  - ### Method Detail

    - #### generateSequence

          public Argument generateSequence(SearchTerm term,
                                  String charset)
                                    throws SearchException,
                                           IOException

      Generate the IMAP search sequence for the given search expression.
      Parameters:
        `term` - the search term
        `charset` - charset for the search
      Returns:
        the SEARCH Argument
      Throws:
        `SearchException` - for failures
        `IOException` - for I/O errors

    - #### isAscii

          public static boolean isAscii(SearchTerm term)

      Check if the "text" terms in the given SearchTerm contain non US-ASCII characters.
      Parameters:
        `term` - the search term
      Returns:
        true if only ASCII

    - #### isAscii

          public static boolean isAscii(SearchTerm[] terms)

      Check if any of the "text" terms in the given SearchTerms contain non US-ASCII characters.
      Parameters:
        `terms` - the search terms
      Returns:
        true if only ASCII

    - #### isAscii

          public static boolean isAscii(String s)

      Does this string contain only ASCII characters?
      Parameters:
        `s` - the string
      Returns:
        true if only ASCII

    - #### and

          protected Argument and(AndTerm term,
                     String charset)
                          throws SearchException,
                                 IOException

      Throws:
        `SearchException`
        `IOException`

    - #### or

          protected Argument or(OrTerm term,
                    String charset)
                         throws SearchException,
                                IOException

      Throws:
        `SearchException`
        `IOException`

    - #### not

          protected Argument not(NotTerm term,
                     String charset)
                          throws SearchException,
                                 IOException

      Throws:
        `SearchException`
        `IOException`

    - #### header

          protected Argument header(HeaderTerm term,
                        String charset)
                             throws SearchException,
                                    IOException

      Throws:
        `SearchException`
        `IOException`

    - #### messageid

          protected Argument messageid(MessageIDTerm term,
                           String charset)
                                throws SearchException,
                                       IOException

      Throws:
        `SearchException`
        `IOException`

    - #### flag

          protected Argument flag(FlagTerm term)
                           throws SearchException

      Throws:
        `SearchException`

    - #### from

          protected Argument from(String address,
                      String charset)
                           throws SearchException,
                                  IOException

      Throws:
        `SearchException`
        `IOException`

    - #### recipient

          protected Argument recipient(Message.RecipientType type,
                           String address,
                           String charset)
                                throws SearchException,
                                       IOException

      Throws:
        `SearchException`
        `IOException`

    - #### subject

          protected Argument subject(SubjectTerm term,
                         String charset)
                              throws SearchException,
                                     IOException

      Throws:
        `SearchException`
        `IOException`

    - #### body

          protected Argument body(BodyTerm term,
                      String charset)
                           throws SearchException,
                                  IOException

      Throws:
        `SearchException`
        `IOException`

    - #### size

          protected Argument size(SizeTerm term)
                           throws SearchException

      Throws:
        `SearchException`

    - #### toIMAPDate

          protected String toIMAPDate(Date date)

    - #### sentdate

          protected Argument sentdate(DateTerm term)
                               throws SearchException

      Throws:
        `SearchException`

    - #### receiveddate

          protected Argument receiveddate(DateTerm term)
                                   throws SearchException

      Throws:
        `SearchException`

    - #### older

          protected Argument older(OlderTerm term)
                            throws SearchException

      Generate argument for OlderTerm.
      Parameters:
        `term` - the search term
      Returns:
        the SEARCH Argument
      Throws:
        `SearchException` - for failures
      Since:
        JavaMail 1.5.1

    - #### younger

          protected Argument younger(YoungerTerm term)
                              throws SearchException

      Generate argument for YoungerTerm.
      Parameters:
        `term` - the search term
      Returns:
        the SEARCH Argument
      Throws:
        `SearchException` - for failures
      Since:
        JavaMail 1.5.1

    - #### modifiedSince

          protected Argument modifiedSince(ModifiedSinceTerm term)
                                    throws SearchException

      Generate argument for ModifiedSinceTerm.
      Parameters:
        `term` - the search term
      Returns:
        the SEARCH Argument
      Throws:
        `SearchException` - for failures
      Since:
        JavaMail 1.5.1

Copyright © 2016 Oracle. All rights reserved.