Package herddb.utils
Class DiskArrayList<T>
- java.lang.Object
-
- herddb.utils.DiskArrayList<T>
-
- All Implemented Interfaces:
AutoCloseable,Iterable<T>
public final class DiskArrayList<T> extends Object implements AutoCloseable, Iterable<T>
ArrayList backed by disk- Author:
- enrico.olivelli
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceDiskArrayList.Serializer<T>
-
Constructor Summary
Constructors Constructor Description DiskArrayList(int swapThreshold, Path tmpDir, DiskArrayList.Serializer<T> serializer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(T summary)voidclose()voidenableCompression()voidfinish()booleanisCompressionEnabled()booleanisEmpty()booleanisSwapped()Iterator<T>iterator()intsize()voidsortBuffer(Comparator<T> comparator)voidtruncate(int size)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
DiskArrayList
public DiskArrayList(int swapThreshold, Path tmpDir, DiskArrayList.Serializer<T> serializer)
-
-
Method Detail
-
enableCompression
public void enableCompression()
-
isCompressionEnabled
public boolean isCompressionEnabled()
-
add
public void add(T summary)
-
isSwapped
public boolean isSwapped()
-
isEmpty
public boolean isEmpty()
-
size
public int size()
-
sortBuffer
public void sortBuffer(Comparator<T> comparator)
-
finish
public void finish()
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable
-
truncate
public void truncate(int size)
-
-