com.sun.mail.imap.protocol

## Class UIDSet

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

-     public class UIDSet
      extends Object

  This class holds the 'start' and 'end' for a range of UIDs. Just like MessageSet except using long instead of int.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `long` | `end`
    `long` | `start`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UIDSet()`
    `UIDSet(long start, long end)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static UIDSet[]` | `createUIDSets(long[] uids)` Convert an array of longs into an array of UIDSets
    `static UIDSet[]` | `parseUIDSets(String uids)` Parse a string in IMAP UID range format.
    `long` | `size()` Count the total number of elements in a UIDSet
    `static long` | `size(UIDSet[] uidset)` Count the total number of elements in an array of UIDSets.
    `static long[]` | `toArray(UIDSet[] uidset)` Convert an array of UIDSets into a array of long UIDs.
    `static long[]` | `toArray(UIDSet[] uidset, long uidmax)` Convert an array of UIDSets into a array of long UIDs.
    `static String` | `toString(UIDSet[] uidset)` Convert an array of UIDSets into an IMAP sequence range.

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

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

- - ### Field Detail

    - #### start

          public long start

    - #### end

          public long end

  - ### Constructor Detail

    - #### UIDSet

          public UIDSet()

    - #### UIDSet

          public UIDSet(long start,
                long end)

  - ### Method Detail

    - #### size

          public long size()

      Count the total number of elements in a UIDSet
      Returns:
        the number of elements

    - #### createUIDSets

          public static UIDSet[] createUIDSets(long[] uids)

      Convert an array of longs into an array of UIDSets
      Parameters:
        `uids` - the UIDs
      Returns:
        array of UIDSet objects

    - #### parseUIDSets

          public static UIDSet[] parseUIDSets(String uids)

      Parse a string in IMAP UID range format.
      Parameters:
        `uids` - UID string
      Returns:
        array of UIDSet objects
      Since:
        JavaMail 1.5.1

    - #### toString

          public static String toString(UIDSet[] uidset)

      Convert an array of UIDSets into an IMAP sequence range.
      Parameters:
        `uidset` - the UIDSets
      Returns:
        the IMAP sequence string

    - #### toArray

          public static long[] toArray(UIDSet[] uidset)

      Convert an array of UIDSets into a array of long UIDs.
      Parameters:
        `uidset` - the UIDSets
      Returns:
        arrray of UIDs
      Since:
        JavaMail 1.5.1

    - #### toArray

          public static long[] toArray(UIDSet[] uidset,
                       long uidmax)

      Convert an array of UIDSets into a array of long UIDs. Don't include any UIDs larger than uidmax.
      Parameters:
        `uidset` - the UIDSets
        `uidmax` - maximum UID
      Returns:
        arrray of UIDs
      Since:
        JavaMail 1.5.1

    - #### size

          public static long size(UIDSet[] uidset)

      Count the total number of elements in an array of UIDSets.
      Parameters:
        `uidset` - the UIDSets
      Returns:
        the number of elements

Copyright © 2016 Oracle. All rights reserved.