Class FileList

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

    public class FileList
    extends ListAdapter<java.io.File>
    Collection representing a list of files. Each entry in the list is unique; i.e. a single file can't be added to the list more than once.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      FileList()  
      FileList​(java.util.List<java.io.File> files)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int add​(java.io.File file)
      Adds an item to the list.
      void insert​(java.io.File file, int index)
      Inserts an item into the list.
      void setComparator​(java.util.Comparator<java.io.File> comparator)
      Sets the collection's sort order, re-ordering the collection's contents and ensuring that new entries preserve the sort order.
      java.io.File update​(int index, java.io.File file)
      Updates the item at the given index.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • FileList

        public FileList()
      • FileList

        public FileList​(java.util.List<java.io.File> files)
    • Method Detail

      • add

        public int add​(java.io.File file)
        Description copied from interface: List
        Adds an item to the list. If the list is unsorted, the item is appended to the end of the list. Otherwise, it is inserted at the appropriate index.
        Specified by:
        add in interface List<java.io.File>
        Specified by:
        add in interface Sequence<java.io.File>
        Overrides:
        add in class ListAdapter<java.io.File>
        Parameters:
        file - The item to be added to the sequence.
        Returns:
        The index at which the item was added.
        See Also:
        ListListener.itemInserted(List, int)
      • insert

        @UnsupportedOperation
        public void insert​(java.io.File file,
                           int index)
        Description copied from interface: List
        Inserts an item into the list.
        Specified by:
        insert in interface List<java.io.File>
        Specified by:
        insert in interface Sequence<java.io.File>
        Overrides:
        insert in class ListAdapter<java.io.File>
        Parameters:
        file - The item to be added to the list.
        index - The index at which the item should be inserted. Must be a value between 0 and getLength().
        See Also:
        ListListener.itemInserted(List, int)
      • update

        @UnsupportedOperation
        public java.io.File update​(int index,
                                   java.io.File file)
        Description copied from interface: List
        Updates the item at the given index.
        Specified by:
        update in interface List<java.io.File>
        Specified by:
        update in interface Sequence<java.io.File>
        Overrides:
        update in class ListAdapter<java.io.File>
        Parameters:
        index - The index of the item to update.
        file - The item that will replace any existing value at the given index.
        Returns:
        The item that was previously stored at the given index.
        See Also:
        ListListener.itemUpdated(List, int, Object)
      • setComparator

        @UnsupportedOperation
        public void setComparator​(java.util.Comparator<java.io.File> comparator)
        Description copied from interface: Collection
        Sets the collection's sort order, re-ordering the collection's contents and ensuring that new entries preserve the sort order.

        Calling this method more than once with the same comparator will re-sort the collection.

        Specified by:
        setComparator in interface Collection<java.io.File>
        Specified by:
        setComparator in interface List<java.io.File>
        Overrides:
        setComparator in class ListAdapter<java.io.File>
        Parameters:
        comparator - The comparator used to order elements in the collection, or null if the collection is unsorted.
        See Also:
        ListListener.comparatorChanged(List, Comparator)