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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
void
clear()
boolean
boolean
containsAll(Collection<?> c)
boolean
get(int index)
protected abstract int
protected abstract CtElement
getOwner()
protected abstract CtRole
getRole()
int
hashCode()
int
boolean
isEmpty()
int
lastIndexOf(Object o)
protected void
onSizeChanged(int newSize)
remove(int index)
boolean
void
set(Collection<T> elements)
sets the new content of this Listint
size()
Object[]
toArray()
<T> T[]
toArray(T[] a)
protected void
Methods inherited from class java.util.AbstractList
addAll, iterator, listIterator, listIterator, removeRange, subList
Methods inherited from class java.util.AbstractCollection
addAll, removeAll, retainAll, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods 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:
containsAll
in interfaceCollection<T extends CtElement>
- Specified by:
containsAll
in interfaceList<T extends CtElement>
- Overrides:
containsAll
in classAbstractCollection<T extends CtElement>
-
clear
public void clear() -
equals
-
hashCode
public int hashCode() -
add
-
remove
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOf
in interfaceList<T extends CtElement>
- Overrides:
lastIndexOf
in classAbstractList<T extends CtElement>
-
updateModCount
protected void updateModCount()
-