public class SwappingList<T>
extends java.lang.Object
implements java.util.List<T>
| Constructor and Description |
|---|
SwappingList()
Constructs a new swapping list.
|
SwappingList(int max,
int keep)
Constructs a new swapping list.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
T element) |
boolean |
add(T o) |
boolean |
addAll(java.util.Collection<? extends T> c) |
boolean |
addAll(int index,
java.util.Collection<? extends T> c) |
void |
clear() |
boolean |
contains(java.lang.Object o)
Returns true if this list contains the specified element.
|
boolean |
containsAll(java.util.Collection<?> c) |
boolean |
equals(java.lang.Object o) |
T |
get(int index)
Gets an object of this list.
|
int |
getKeepMemoryEntries()
Gets the number of (last) objects that are keeped in memory when
objects are swapped to disc.
|
int |
getMaxMemoryEntries()
Sets the maximum number of (last) objects that are hold in memory.
|
int |
getMemoryIndex()
Gets the index of first element that is in memory.
|
java.io.File |
getPageFile()
Gets the page-file of this swapping list.
|
int |
hashCode() |
int |
indexOf(java.lang.Object o) |
boolean |
isEmpty()
Returns true if this list contains no elements.
|
java.util.Iterator<T> |
iterator() |
int |
lastIndexOf(java.lang.Object o) |
java.util.ListIterator<T> |
listIterator() |
java.util.ListIterator<T> |
listIterator(int index) |
T |
remove(int index) |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
retainAll(java.util.Collection<?> c) |
T |
set(int index,
T element)
Sets the object at a given position.
|
void |
setKeepMemoryEntries(int keep)
Sets the number of (last) objects that are keeped in memory when
objects are swapped to disc.
|
void |
setMaxMemoryEntries(int max)
Sets the maximum number of (last) objects that are hold in memory.
|
int |
size() |
java.util.List<T> |
subList(int fromIndex,
int toIndex) |
void |
swapAll()
Swaps all elements that are still in memory to disc.
|
java.lang.Object[] |
toArray() |
java.lang.Object[] |
toArray(java.lang.Object[] a) |
public SwappingList()
public SwappingList(int max,
int keep)
max - Maximum number of objects in memory.keep - Number of objects keeped in memory when swapped to disc.public int getMemoryIndex()
public void setMaxMemoryEntries(int max)
max - Maximum number of objects in memory.public int getMaxMemoryEntries()
public void setKeepMemoryEntries(int keep)
keep - Number of objects keeped in memory when swapped to disc.public int getKeepMemoryEntries()
public java.io.File getPageFile()
public void swapAll()
public int size()
public boolean isEmpty()
public boolean contains(java.lang.Object o)
public java.util.Iterator<T> iterator()
public java.lang.Object[] toArray()
public java.lang.Object[] toArray(java.lang.Object[] a)
public boolean add(T o)
public boolean remove(java.lang.Object o)
public boolean containsAll(java.util.Collection<?> c)
public boolean addAll(java.util.Collection<? extends T> c)
public boolean addAll(int index,
java.util.Collection<? extends T> c)
addAll in interface java.util.List<T>public boolean removeAll(java.util.Collection<?> c)
public boolean retainAll(java.util.Collection<?> c)
public void clear()
public boolean equals(java.lang.Object o)
public int hashCode()
public T get(int index)
get in interface java.util.List<T>index - Index of object.java.lang.IndexOutOfBoundsException - is thrown if index is invalid.public T set(int index, T element)
set in interface java.util.List<T>index - Index of element.element - Element.java.lang.IndexOutOfBoundsException - is thrown if index is invalid.public int indexOf(java.lang.Object o)
indexOf in interface java.util.List<T>public int lastIndexOf(java.lang.Object o)
lastIndexOf in interface java.util.List<T>public java.util.ListIterator<T> listIterator()
listIterator in interface java.util.List<T>public java.util.ListIterator<T> listIterator(int index)
listIterator in interface java.util.List<T>© 2003-2011 by Sascha Schmidt (vision-cloud.de). All Rights Reserved.