Package spoon.support.util
Class ModelList<T extends CtElement>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<T>
spoon.support.util.ModelList<T>
- All Implemented Interfaces:
Serializable,Iterable<T>,Collection<T>,List<T>
public abstract class ModelList<T extends CtElement>
extends AbstractList<T>
implements Serializable
The implementation of the
List, which is used by Spoon model objects.
It assures:
1) each inserted CtElement gets assigned correct parent
2) each change is reported in FineModelChangeListener- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanvoidclear()booleanbooleancontainsAll(Collection<?> c)booleanget(int index)protected abstract intprotected abstract CtElementgetOwner()protected abstract CtRolegetRole()inthashCode()intbooleanisEmpty()intlastIndexOf(Object o)protected voidonSizeChanged(int newSize)remove(int index)booleanvoidset(Collection<T> elements)sets the new content of this Listintsize()Object[]toArray()<T> T[]toArray(T[] a)protected voidMethods inherited from class java.util.AbstractList
addAll, iterator, listIterator, listIterator, removeRange, subListMethods inherited from class java.util.AbstractCollection
addAll, removeAll, retainAll, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
addAll, removeAll, replaceAll, retainAll, sort, spliterator
-
Constructor Details
-
ModelList
protected ModelList()
-
-
Method Details
-
getOwner
-
getRole
-
getDefaultCapacity
protected abstract int getDefaultCapacity() -
onSizeChanged
protected void onSizeChanged(int newSize) -
get
-
set
sets the new content of this List- Parameters:
elements- new content of this list
-
size
public int size() -
set
-
contains
-
isEmpty
public boolean isEmpty() -
toArray
-
toArray
public <T> T[] toArray(T[] a) -
add
-
remove
-
containsAll
- Specified by:
containsAllin interfaceCollection<T extends CtElement>- Specified by:
containsAllin interfaceList<T extends CtElement>- Overrides:
containsAllin classAbstractCollection<T extends CtElement>
-
clear
public void clear() -
equals
-
hashCode
public int hashCode() -
add
-
remove
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<T extends CtElement>- Overrides:
lastIndexOfin classAbstractList<T extends CtElement>
-
updateModCount
protected void updateModCount()
-