Package org.luwrain.controls
Class ListUtils.DefaultEditableModel<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<E>
org.luwrain.controls.ListUtils.DefaultEditableModel<E>
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<E>,Collection<E>,List<E>,RandomAccess,SequencedCollection<E>,EditableListArea.Model<E>,ListArea.Model<E>
- Enclosing class:
ListUtils
public static class ListUtils.DefaultEditableModel<E>
extends ArrayList<E>
implements EditableListArea.Model<E>
- See Also:
-
Field Summary
FieldsFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionDefaultEditableModel(Class<E> itemClass) DefaultEditableModel(Class<E> itemClass, E[] items) DefaultEditableModel(Class<E> itemClass, List<E> items) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddToModel(int pos, Supplier<Object> supplier) protected EgetItem(int index) Returns the item at the given index.intReturns the total number of items in the model.Object[]getItems()voidrefresh()Called when the underlying data has changed and the list needs to be refreshed.booleanremoveFromModel(int fromIndex, int toIndex) voidMethods inherited from class java.util.ArrayList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractCollection
containsAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
containsAll, reversed
-
Field Details
-
itemClass
-
-
Constructor Details
-
DefaultEditableModel
-
DefaultEditableModel
-
DefaultEditableModel
-
-
Method Details
-
setItems
-
getItems
-
addToModel
- Specified by:
addToModelin interfaceEditableListArea.Model<E>
-
removeFromModel
public boolean removeFromModel(int fromIndex, int toIndex) - Specified by:
removeFromModelin interfaceEditableListArea.Model<E>
-
getItemCount
public int getItemCount()Description copied from interface:ListArea.ModelReturns the total number of items in the model.- Specified by:
getItemCountin interfaceListArea.Model<E>- Returns:
- the item count
-
getItem
Description copied from interface:ListArea.ModelReturns the item at the given index.- Specified by:
getItemin interfaceListArea.Model<E>- Parameters:
index- the zero-based index of the item- Returns:
- the item at that position, or
nullif the index is out of bounds
-
refresh
public void refresh()Description copied from interface:ListArea.ModelCalled when the underlying data has changed and the list needs to be refreshed. Implementations should reload or update their data.- Specified by:
refreshin interfaceListArea.Model<E>
-
adjust
-