Package com.microej.kf.util
Class KFList2<T>
- java.lang.Object
-
- com.microej.kf.util.AbstractKFList<T>
-
- com.microej.kf.util.KFList2<T>
-
- All Implemented Interfaces:
ej.kf.FeatureStateListener,java.lang.Iterable<T>,java.util.Collection<T>
public class KFList2<T> extends AbstractKFList<T>
Implementation of aAbstractKFListoptimized for heap size. All internal arrays are resized, and iterators are executed without extra object copy.- See Also:
KFList
-
-
Constructor Summary
Constructors Constructor Description KFList2()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(T element)booleanaddAll(java.util.Collection<? extends T> c)voidclear()booleancontains(java.lang.Object element)booleanisEmpty()java.util.Iterator<T>iterator()booleanremove(java.lang.Object element)protected voidremoveAllElementsOwnedBy(ej.kf.Feature feature)Removed all elements owned by the givenFeature.intsize()protected voidtoArray(java.util.ArrayList<T> allList)Add all the elements of the collection to the givenArrayList.-
Methods inherited from class com.microej.kf.util.AbstractKFList
containsAll, removeAll, retainAll, stateChanged, toArray, toArray
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Method Detail
-
contains
public boolean contains(java.lang.Object element)
-
add
public boolean add(T element)
- Throws:
java.lang.IllegalArgumentException- if this method is called by the Kernel and the element is owned by a Feature.
-
remove
public boolean remove(java.lang.Object element)
-
iterator
public java.util.Iterator<T> iterator()
-
addAll
public boolean addAll(java.util.Collection<? extends T> c)
- Specified by:
addAllin interfacejava.util.Collection<T>- Overrides:
addAllin classAbstractKFList<T>
-
clear
public void clear()
-
isEmpty
public boolean isEmpty()
-
size
public int size()
-
toArray
protected void toArray(java.util.ArrayList<T> allList)
Description copied from class:AbstractKFListAdd all the elements of the collection to the givenArrayList.- Specified by:
toArrayin classAbstractKFList<T>- Parameters:
allList- the list where all elements are added.
-
removeAllElementsOwnedBy
protected void removeAllElementsOwnedBy(ej.kf.Feature feature)
Description copied from class:AbstractKFListRemoved all elements owned by the givenFeature.- Specified by:
removeAllElementsOwnedByin classAbstractKFList<T>- Parameters:
feature- the owner of the elements to be removed
-
-