Class MailboxList

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Iterable<Mailbox>, java.util.Collection<Mailbox>, java.util.List<Mailbox>

    public class MailboxList
    extends java.util.AbstractList<Mailbox>
    implements java.io.Serializable
    An immutable, random-access list of Mailbox objects.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List<Mailbox> mailboxes  
      private static long serialVersionUID  
      • Fields inherited from class java.util.AbstractList

        modCount
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Mailbox get​(int index)
      Gets an address.
      int size()
      The number of elements in this list.
      • Methods inherited from class java.util.AbstractList

        add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
      • Methods inherited from class java.util.AbstractCollection

        addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
    • Field Detail

      • mailboxes

        private final java.util.List<Mailbox> mailboxes
    • Constructor Detail

      • MailboxList

        public MailboxList​(java.util.List<Mailbox> mailboxes,
                           boolean dontCopy)
        Parameters:
        mailboxes - A List that contains only Mailbox objects.
        dontCopy - true iff it is not possible for the mailboxes list to be modified by someone else.
      • MailboxList

        public MailboxList​(java.util.List<Mailbox> mailboxes)
        Parameters:
        mailboxes - A List that contains only Mailbox objects.
      • MailboxList

        public MailboxList​(Mailbox... mailboxes)
        Parameters:
        mailboxes - A List that contains only Mailbox objects.
    • Method Detail

      • size

        public int size()
        The number of elements in this list.
        Specified by:
        size in interface java.util.Collection<Mailbox>
        Specified by:
        size in interface java.util.List<Mailbox>
        Specified by:
        size in class java.util.AbstractCollection<Mailbox>
      • get

        public Mailbox get​(int index)
        Gets an address.
        Specified by:
        get in interface java.util.List<Mailbox>
        Specified by:
        get in class java.util.AbstractList<Mailbox>