Module com.aoapps.hodgepodge
Package com.aoapps.hodgepodge.io
Class FileList<T extends FileListObject>
java.lang.Object
java.util.AbstractCollection<T>
java.util.AbstractList<T>
com.aoapps.hodgepodge.io.FileList<T>
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterable<T>,Collection<T>,List<T>,RandomAccess
public class FileList<T extends FileListObject>
extends AbstractList<T>
implements RandomAccess, Closeable
A
FileList is a List that stores its objects in
a fixed-record-size file.- Author:
- AO Industries, Inc.
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionFileList(String filenamePrefix, String filenameExtension, int objectLength, FileListObjectFactory<T> objectFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanaddAll(int index, Collection<? extends T> collection) booleanaddAll(Collection<? extends T> collection) voidclear()voidclose()get(int index) intstatic FilegetTempFile(String prefix, String extension) Deprecated.remove(int index) intsize()voidswap(int index1, int index2) Methods inherited from class java.util.AbstractList
add, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subListMethods inherited from class java.util.AbstractCollection
contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
Constructor Details
-
FileList
public FileList(String filenamePrefix, String filenameExtension, int objectLength, FileListObjectFactory<T> objectFactory) throws IOException - Throws:
IOException
-
-
Method Details
-
clear
public void clear()- Specified by:
clearin interfaceCollection<T extends FileListObject>- Specified by:
clearin interfaceList<T extends FileListObject>- Overrides:
clearin classAbstractList<T extends FileListObject>
-
get
- Specified by:
getin interfaceList<T extends FileListObject>- Specified by:
getin classAbstractList<T extends FileListObject>
-
swap
public void swap(int index1, int index2) -
size
public int size()- Specified by:
sizein interfaceCollection<T extends FileListObject>- Specified by:
sizein interfaceList<T extends FileListObject>- Specified by:
sizein classAbstractCollection<T extends FileListObject>
-
getRecordLength
public int getRecordLength() -
set
- Specified by:
setin interfaceList<T extends FileListObject>- Overrides:
setin classAbstractList<T extends FileListObject>
-
add
- Specified by:
addin interfaceList<T extends FileListObject>- Overrides:
addin classAbstractList<T extends FileListObject>
-
addAll
- Specified by:
addAllin interfaceCollection<T extends FileListObject>- Specified by:
addAllin interfaceList<T extends FileListObject>- Overrides:
addAllin classAbstractCollection<T extends FileListObject>
-
addAll
- Specified by:
addAllin interfaceList<T extends FileListObject>- Overrides:
addAllin classAbstractList<T extends FileListObject>
-
remove
- Specified by:
removein interfaceList<T extends FileListObject>- Overrides:
removein classAbstractList<T extends FileListObject>
-
getFilenamePrefix
-
getFilenameExtension
-
getObjectFactory
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getTempFile
Deprecated.Please useTempFileContextasFile.deleteOnExit()is prone to memory leaks in long-running applications.- Throws:
IOException
-

TempFileContextasFile.deleteOnExit()is prone to memory leaks in long-running applications.