Class DataListHolder<DATA,​SELECTOR>

  • Type Parameters:
    DATA - The type of data elements in the list.

    public class DataListHolder<DATA,​SELECTOR>
    extends java.lang.Object
    Holder class that encapsulates access to the list of DATA objects used for ReadListFeatureFunction and ReadAndWriteListFeatureFunction. Implements many of the operations that just need to access the list and manipulate its data.

    Methods on this class perform no validation or notification. However, they take functional interfaces as parameters, and/or return lists of notifications, so that the feature functions can hook in validation and notification properly.

    • Field Detail

      • dataList

        protected final java.util.List<DATA> dataList
    • Method Detail

      • getDataCopy

        public DATA getDataCopy​(int idx)
        Get a copy of the list entry at a specified index.
        Parameters:
        idx - The index to copy from
        Returns:
        (a copy of) the entry at the given index.
      • getDataCopyForFirst

        public DATA getDataCopyForFirst​(java.util.function.Predicate<DATA> predicate)
        Returns a copy of the first found data for the given condition.
        Parameters:
        predicate - the condition
        Returns:
        copy of the first found data, null if none is found
      • getDataCopiesFor

        public java.util.List<DATA> getDataCopiesFor​(java.util.function.Predicate<DATA> predicate)
        Returns a list of data copies for data that matches given condition
        Parameters:
        predicate - the condition
        Returns:
        list of data copies
      • getDataCopies

        public java.util.List<DATA> getDataCopies​(java.util.List<java.lang.Integer> idxList)
      • getFullCopy

        public java.util.List<DATA> getFullCopy()