Class Comet3CollectionImpl<T extends Comet3Entity>

    • Field Summary

      • Fields inherited from class java.util.AbstractList

        modCount
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T findById​(int id)
      Lookup the Entity refered by id in this collection.
      java.lang.Long getLastModificationTimestamp()
      Get the time (unix timestamp) the collection was modified last
      java.util.List<T> getList()
      Gets list.
      java.lang.String getXmlFileName()
      Get the name of the XML file associated with this particular collection.
      java.lang.String getXmlRootElementName()
      Get the name of the XML root element.
      Comet3Collection<T> merge​(Comet3Collection<T> other)
      Merge collection other into the actual collection.
      Comet3Collection<T> merge​(Comet3Collection<T> other, boolean deleteObj)
      Merge collection other into the actual collection.
      void merge​(T item)
      Merge an item into the actual list.
      void setLastModificationTimestamp​(java.lang.Long lastModificationTimestamp)
      Set the time the collection was modified last
      void setList​(java.util.List<T> list)
      Sets list.
      • Methods inherited from class java.util.ArrayList

        add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
      • Methods inherited from class java.util.AbstractCollection

        containsAll, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

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

        forEach
      • Methods inherited from interface java.util.List

        add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
    • Constructor Detail

      • Comet3CollectionImpl

        public Comet3CollectionImpl()
    • Method Detail

      • merge

        public Comet3Collection<T> merge​(Comet3Collection<T> other)
        Description copied from interface: Comet3Collection
        Merge collection other into the actual collection. Entries will be compared by ID, i.e.: equal IDs will be considered as equal objects. Newer objects take precedence over older, if both have the same modification date objects in collection other take precedence over objects in the actual collection.
        Specified by:
        merge in interface Comet3Collection<T extends Comet3Entity>
        Parameters:
        other - the other
        Returns:
        a newly created collection containing the most recent entities of both lists
      • merge

        public Comet3Collection<T> merge​(Comet3Collection<T> other,
                                         boolean deleteObj)
        Description copied from interface: Comet3Collection
        Merge collection other into the actual collection. Entries will be compared by ID, i.e.: equal IDs will be considered as equal objects. Newer objects take precedence over older, if both have the same modification date objects in collection other take precedence over objects in the actual collection. If deleteObj is set to true, objects not contained in collection other will be deleted from the actual collection.
        Specified by:
        merge in interface Comet3Collection<T extends Comet3Entity>
        Parameters:
        other - the other
        deleteObj - the delete obj
        Returns:
        a newly created collection containing the most recent entities of both lists
      • merge

        public void merge​(T item)
        Description copied from interface: Comet3Collection
        Merge an item into the actual list. If this item does not yet exist (i.e.: there is no such object with the same Id), the item will be added, otherwise items will be merged according to the merge rules for this particular entity type.
        Specified by:
        merge in interface Comet3Collection<T extends Comet3Entity>
        Parameters:
        item - the item
      • setLastModificationTimestamp

        public void setLastModificationTimestamp​(java.lang.Long lastModificationTimestamp)
        Description copied from interface: Comet3Collection
        Set the time the collection was modified last
        Specified by:
        setLastModificationTimestamp in interface Comet3Collection<T extends Comet3Entity>
        Parameters:
        lastModificationTimestamp - the timestamp
      • getList

        public java.util.List<T> getList()
        Gets list.
        Returns:
        the list
      • findById

        public T findById​(int id)
        Description copied from interface: Comet3Collection
        Lookup the Entity refered by id in this collection.
        Specified by:
        findById in interface Comet3Collection<T extends Comet3Entity>
        Parameters:
        id - the id
        Returns:
        Entity object or null, if no such object exists
      • getXmlRootElementName

        public java.lang.String getXmlRootElementName()
        Description copied from interface: Comet3Collection
        Get the name of the XML root element. Typically this is getClass().getSimpleName().toLowerCase() and is implemented in the CometCollectionImpl adapter class.
        Specified by:
        getXmlRootElementName in interface Comet3Collection<T extends Comet3Entity>
        Returns:
        name of the XML root element
      • getXmlFileName

        public java.lang.String getXmlFileName()
        Description copied from interface: Comet3Collection
        Get the name of the XML file associated with this particular collection. Typically this is getClass().getSimpleName().toLowerCase() + ".xml" and is implemented in the CometCollectionImpl adapter class
        Specified by:
        getXmlFileName in interface Comet3Collection<T extends Comet3Entity>
        Returns:
        name of a XML file holding this particular list
      • setList

        public void setList​(java.util.List<T> list)
        Sets list.
        Parameters:
        list - the list