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
    Description
    long
     
    long
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    UIDSet(long start, long end)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static UIDSet[]
    createUIDSets(long[] uids)
    Convert an array of longs into an array of UIDSets
    static UIDSet[]
    Parse a string in IMAP UID range format.
    long
    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

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • start

      public long start
    • end

      public long end
  • Constructor Details

    • UIDSet

      public UIDSet()
    • UIDSet

      public UIDSet(long start, long end)
  • Method Details

    • 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