Class FileList
- java.lang.Object
-
- ca.odell.glazedlists.AbstractEventList<E>
-
- ca.odell.glazedlists.TransformedList
-
- ca.odell.glazedlists.io.FileList
-
- All Implemented Interfaces:
ListEventListener
,EventList
,java.lang.Iterable
,java.util.Collection
,java.util.EventListener
,java.util.List
public final class FileList extends TransformedList
AnEventList
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 usePerformance: N/A Memory: O(N) Unit Tests: N/A Issues: N/A - Author:
- Jesse Wilson
-
-
Field Summary
-
Fields inherited from class ca.odell.glazedlists.TransformedList
source
-
Fields inherited from class ca.odell.glazedlists.AbstractEventList
publisher, readWriteLock, updates
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes this FileList so that it consumes no disc resources.void
dispose()
Releases the resources consumed by thisTransformedList
so that it may eventually be garbage collected.boolean
isWritable()
Gets whether the sourceEventList
is writable via this API.void
listChanged(ListEvent listChanges)
When the underlying list changes, this notification allows the object to repaint itself or update itself as necessary.-
Methods inherited from class ca.odell.glazedlists.TransformedList
add, addAll, clear, get, getSourceIndex, remove, removeAll, retainAll, set, size
-
Methods inherited from class ca.odell.glazedlists.AbstractEventList
add, addAll, addListEventListener, contains, containsAll, equals, getPublisher, getReadWriteLock, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, removeListEventListener, subList, toArray, toArray, toString
-
-
-
-
Method Detail
-
isWritable
public boolean isWritable()
Gets whether the sourceEventList
is writable via this API.Extending classes must override this method in order to make themselves writable.
- Specified by:
isWritable
in classTransformedList
-
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 interfaceListEventListener
- Specified by:
listChanged
in classTransformedList
- Parameters:
listChanges
- aListEvent
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 isdisposed
.
-
dispose
public void dispose()
Releases the resources consumed by thisTransformedList
so that it may eventually be garbage collected.A
TransformedList
will be garbage collected without a call toTransformedList.dispose()
, but not before its sourceEventList
is garbage collected. By callingTransformedList.dispose()
, you allow theTransformedList
to be garbage collected before its sourceEventList
. This is necessary for situations where aTransformedList
is short-lived but its sourceEventList
is long-lived.Warning: It is an error to call any method on a
TransformedList
after it has been disposed.- Specified by:
dispose
in interfaceEventList
- Overrides:
dispose
in classTransformedList
-
-