Class KFList<T>

  • All Implemented Interfaces:
    ej.kf.FeatureStateListener, java.lang.Iterable<T>, java.util.Collection<T>

    public class KFList<T>
    extends AbstractKFList<T>
    Implementation of a AbstractKFList optimized for speed. Access of elements through HashMap and ArrayList.
    See Also:
    KFList2
    • Constructor Summary

      Constructors 
      Constructor Description
      KFList()  
      KFList​(int initialNbContexts)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(T element)  
      void clear()  
      boolean contains​(java.lang.Object element)  
      boolean isEmpty()  
      java.util.Iterator<T> iterator()  
      boolean remove​(java.lang.Object element)  
      protected void removeAllElementsOwnedBy​(ej.kf.Feature feature)
      Removed all elements owned by the given Feature.
      int size()  
      protected void toArray​(java.util.ArrayList<T> allList)
      Add all the elements of the collection to the given ArrayList.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
    • Constructor Detail

      • KFList

        public KFList()
      • KFList

        public KFList​(int initialNbContexts)
    • 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()
      • 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: AbstractKFList
        Add all the elements of the collection to the given ArrayList.
        Specified by:
        toArray in class AbstractKFList<T>
        Parameters:
        allList - the list where all elements are added.
      • removeAllElementsOwnedBy

        protected void removeAllElementsOwnedBy​(ej.kf.Feature feature)
        Description copied from class: AbstractKFList
        Removed all elements owned by the given Feature.
        Specified by:
        removeAllElementsOwnedBy in class AbstractKFList<T>
        Parameters:
        feature - the owner of the elements to be removed