public class PersistedList<T> extends AbstractList<T>
| Modifier and Type | Class and Description |
|---|---|
static class |
PersistedList.ConverterImpl
Converter implementation for XStream. |
| Modifier and Type | Field and Description |
|---|---|
protected CopyOnWriteList<T> |
data |
protected Saveable |
owner |
modCount| Modifier | Constructor and Description |
|---|---|
protected |
PersistedList() |
protected |
PersistedList(Collection<? extends T> initialList) |
|
PersistedList(Saveable owner) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T item) |
boolean |
addAll(Collection<? extends T> items) |
void |
addAllTo(Collection<? super T> dst) |
void |
clear() |
boolean |
contains(Object item) |
<U extends T> |
get(Class<U> type) |
T |
get(int index) |
<U extends T> |
getAll(Class<U> type)
Gets all instances that matches the given type.
|
boolean |
isEmpty() |
Iterator<T> |
iterator() |
protected void |
onModified()
Called when a list is mutated.
|
void |
remove(Class<? extends T> type)
Removes an instance by its type.
|
boolean |
remove(Object o) |
void |
removeAll(Class<? extends T> type) |
void |
replace(T from,
T to)
A convenience method to replace a single item.
|
void |
replaceBy(Collection<? extends T> col) |
void |
setOwner(Saveable owner) |
int |
size() |
<T> T[] |
toArray(T[] array)
Gets all the
Describables in an array. |
List<T> |
toList()
Returns the snapshot view of instances as list.
|
String |
toString() |
add, addAll, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subListcontainsAll, removeAll, retainAll, toArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitcontainsAll, removeAll, replaceAll, retainAll, sort, spliterator, toArrayparallelStream, removeIf, streamprotected final CopyOnWriteList<T> data
protected Saveable owner
protected PersistedList()
protected PersistedList(Collection<? extends T> initialList)
public PersistedList(Saveable owner)
public void setOwner(Saveable owner)
@WithBridgeMethods(value=void.class) public boolean add(T item)
add in interface Collection<T>add in interface List<T>add in class AbstractList<T>@WithBridgeMethods(value=void.class) public boolean addAll(Collection<? extends T> items)
addAll in interface Collection<T>addAll in interface List<T>addAll in class AbstractCollection<T>public void replaceBy(Collection<? extends T> col) throws IOException
IOExceptionpublic T get(int index)
public <U extends T> List<U> getAll(Class<U> type)
public int size()
size in interface Collection<T>size in interface List<T>size in class AbstractCollection<T>public void remove(Class<? extends T> type) throws IOException
IOExceptionpublic void replace(T from, T to) throws IOException
IOExceptionpublic boolean remove(Object o)
remove in interface Collection<T>remove in interface List<T>remove in class AbstractCollection<T>public void removeAll(Class<? extends T> type) throws IOException
IOExceptionpublic void clear()
clear in interface Collection<T>clear in interface List<T>clear in class AbstractList<T>protected void onModified()
throws IOException
IOExceptionpublic <T> T[] toArray(T[] array)
Describables in an array.toArray in interface Collection<T>toArray in interface List<T>toArray in class AbstractCollection<T>public void addAllTo(Collection<? super T> dst)
public boolean isEmpty()
isEmpty in interface Collection<T>isEmpty in interface List<T>isEmpty in class AbstractCollection<T>public boolean contains(Object item)
contains in interface Collection<T>contains in interface List<T>contains in class AbstractCollection<T>public String toString()
toString in class AbstractCollection<T>Copyright © 2019. All rights reserved.