Class DataContainerList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<DataContainer>
-
- adams.gui.tools.wekainvestigator.data.DataContainerList
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<DataContainer>
,Collection<DataContainer>
,List<DataContainer>
,RandomAccess
public class DataContainerList extends ArrayList<DataContainer>
For managing the data containers.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_UndoEnabled
whether undo is enabled.-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description DataContainerList()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(DataContainer cont)
Adds the data container and sets the undo enabled flag accordingly.boolean
addAll(Collection<? extends DataContainer> c)
Adds all the data containers and sets their undo enabled flag accordingly.void
clear()
boolean
isUndoEnabled()
Returns whether undo is enabled.DataContainer
remove(int index)
boolean
remove(Object o)
boolean
removeAll(Collection<?> c)
boolean
removeIf(java.util.function.Predicate<? super DataContainer> filter)
protected void
removeRange(int fromIndex, int toIndex)
DataContainer
set(int index, DataContainer element)
void
setUndoEnabled(boolean value)
Sets whether undo is enabled.-
Methods inherited from class java.util.ArrayList
add, addAll, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, replaceAll, retainAll, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
Methods inherited from class java.util.AbstractCollection
containsAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Methods inherited from interface java.util.List
containsAll
-
-
-
-
Method Detail
-
setUndoEnabled
public void setUndoEnabled(boolean value)
Sets whether undo is enabled.- Parameters:
value
- true if enabled
-
isUndoEnabled
public boolean isUndoEnabled()
Returns whether undo is enabled.- Returns:
- true if enabled
-
add
public boolean add(DataContainer cont)
Adds the data container and sets the undo enabled flag accordingly.- Specified by:
add
in interfaceCollection<DataContainer>
- Specified by:
add
in interfaceList<DataContainer>
- Overrides:
add
in classArrayList<DataContainer>
- Parameters:
cont
- the container to add- Returns:
- true if collection modified
-
addAll
public boolean addAll(Collection<? extends DataContainer> c)
Adds all the data containers and sets their undo enabled flag accordingly.- Specified by:
addAll
in interfaceCollection<DataContainer>
- Specified by:
addAll
in interfaceList<DataContainer>
- Overrides:
addAll
in classArrayList<DataContainer>
- Parameters:
c
- the containers to add- Returns:
- true if collection modified
-
set
public DataContainer set(int index, DataContainer element)
- Specified by:
set
in interfaceList<DataContainer>
- Overrides:
set
in classArrayList<DataContainer>
-
remove
public boolean remove(Object o)
- Specified by:
remove
in interfaceCollection<DataContainer>
- Specified by:
remove
in interfaceList<DataContainer>
- Overrides:
remove
in classArrayList<DataContainer>
-
remove
public DataContainer remove(int index)
- Specified by:
remove
in interfaceList<DataContainer>
- Overrides:
remove
in classArrayList<DataContainer>
-
removeRange
protected void removeRange(int fromIndex, int toIndex)
- Overrides:
removeRange
in classArrayList<DataContainer>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAll
in interfaceCollection<DataContainer>
- Specified by:
removeAll
in interfaceList<DataContainer>
- Overrides:
removeAll
in classArrayList<DataContainer>
-
removeIf
public boolean removeIf(java.util.function.Predicate<? super DataContainer> filter)
- Specified by:
removeIf
in interfaceCollection<DataContainer>
- Overrides:
removeIf
in classArrayList<DataContainer>
-
clear
public void clear()
- Specified by:
clear
in interfaceCollection<DataContainer>
- Specified by:
clear
in interfaceList<DataContainer>
- Overrides:
clear
in classArrayList<DataContainer>
-
-