Package com.microej.kf.util
Class AbstractKFList<T>
- java.lang.Object
-
- com.microej.kf.util.AbstractKFList<T>
-
- All Implemented Interfaces:
ej.kf.FeatureStateListener,java.lang.Iterable<T>,java.util.Collection<T>
public abstract class AbstractKFList<T> extends java.lang.Object implements java.util.Collection<T>, ej.kf.FeatureStateListenerImplementation of aCollectionwith multi-context support.This class can only be embedded in Kernel code. It cannot be embedded into Feature code.
This collection does not allow to pass
nullelements.The semantic is the following:
- Each context has its dedicated list, acting as an
ArrayList. - A Feature can add Feature or Kernel objects to its list.
- The Kernel can only add Kernel objects to its list. However it has the full control and visibility on all the
elements of the collection. For example, the call of the
Collection.clear()method clears the whole collection. The call toCollection.iterator()method return an iterator on all objects of the collection...
-
-
Constructor Summary
Constructors Constructor Description AbstractKFList()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanaddAll(java.util.Collection<? extends T> c)booleancontainsAll(java.util.Collection<?> c)booleanremoveAll(java.util.Collection<?> c)protected abstract voidremoveAllElementsOwnedBy(ej.kf.Feature feature)Removed all elements owned by the givenFeature.booleanretainAll(java.util.Collection<?> c)voidstateChanged(ej.kf.Feature feature, ej.kf.Feature.State previousState)java.lang.Object[]toArray()<E> E[]toArray(E[] a)protected abstract voidtoArray(java.util.ArrayList<T> allList)Add all the elements of the collection to the givenArrayList.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Method Detail
-
stateChanged
public final void stateChanged(ej.kf.Feature feature, ej.kf.Feature.State previousState)- Specified by:
stateChangedin interfaceej.kf.FeatureStateListener
-
addAll
public boolean addAll(java.util.Collection<? extends T> c)
- Specified by:
addAllin interfacejava.util.Collection<T>
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
- Specified by:
containsAllin interfacejava.util.Collection<T>
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
- Specified by:
removeAllin interfacejava.util.Collection<T>
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
- Specified by:
retainAllin interfacejava.util.Collection<T>
-
toArray
public java.lang.Object[] toArray()
- Specified by:
toArrayin interfacejava.util.Collection<T>
-
toArray
public <E> E[] toArray(E[] a)
- Specified by:
toArrayin interfacejava.util.Collection<T>
-
removeAllElementsOwnedBy
protected abstract void removeAllElementsOwnedBy(ej.kf.Feature feature)
Removed all elements owned by the givenFeature.- Parameters:
feature- the owner of the elements to be removed
-
toArray
protected abstract void toArray(java.util.ArrayList<T> allList)
Add all the elements of the collection to the givenArrayList.- Parameters:
allList- the list where all elements are added.
-
-