Module jakarta.mail

Class UIDSet


  • public class UIDSet
    extends java.lang.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 end  
      long start  
    • Constructor Summary

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

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static UIDSet[] createUIDSets​(long[] uids)
      Convert an array of longs into an array of UIDSets
      static UIDSet[] parseUIDSets​(java.lang.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 java.lang.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​(java.lang.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 java.lang.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