Class FileList

  • All Implemented Interfaces:
    ListEventListener, EventList, java.lang.Iterable, java.util.Collection, java.util.EventListener, java.util.List

    public final class FileList
    extends TransformedList
    An EventList that is persisted to disk.

    Warning: This class is a technology preview and is subject to API changes.

    EventList Overview
    Writable:yes
    Concurrency:Requires ReadWriteLock for every access, even for single-threaded use
    Performance:N/A
    Memory:O(N)
    Unit Tests:N/A
    Issues:N/A
    Author:
    Jesse Wilson
    • Constructor Detail

      • FileList

        public FileList​(java.io.File file,
                        ByteCoder byteCoder)
                 throws java.io.IOException
        Create a FileList that stores its data in the specified file.
        Throws:
        java.io.IOException
    • Method Detail

      • isWritable

        public boolean isWritable()
        Gets whether the source EventList is writable via this API.

        Extending classes must override this method in order to make themselves writable.

        Specified by:
        isWritable in class TransformedList
      • listChanged

        public void listChanged​(ListEvent listChanges)
        When the underlying list changes, this notification allows the object to repaint itself or update itself as necessary.

        It is mandatory that the calling thread has obtained the write lock on the source list. This is because the calling thread will have written to the source list to cause this event. This condition guarantees that no writes can occur while the listener is handling this event. It is an error to write to the source list while processing an event.

        Specified by:
        listChanged in interface ListEventListener
        Specified by:
        listChanged in class TransformedList
        Parameters:
        listChanges - a ListEvent describing the changes to the list
      • close

        public void close()
        Closes this FileList so that it consumes no disc resources. The list may continue to be read until it is disposed.