Class MultiListProperty<S,​E>

  • Type Parameters:
    S - type of the source object
    E - type of the elements in the list
    All Implemented Interfaces:
    IProperty, IListProperty<S,​E>

    public class MultiListProperty<S,​E>
    extends ListProperty<S,​E>
    A list property for observing multiple list properties in sequence in a combined list.
    Since:
    1.2
    • Constructor Detail

      • MultiListProperty

        public MultiListProperty​(IListProperty<S,​E>[] properties)
        Constructs a MultiListProperty for observing the specified list properties in sequence
        Parameters:
        properties - the list properties
      • MultiListProperty

        public MultiListProperty​(IListProperty<S,​E>[] properties,
                                 Object elementType)
        Constructs a MultiListProperty for observing the specified list properties in sequence.
        Parameters:
        properties - the list properties
        elementType - the element type of the MultiListProperty
    • Method Detail

      • getElementType

        public Object getElementType()
        Description copied from interface: IListProperty
        Returns the type of the elements in the collection or null if untyped
        Returns:
        the type of the elements in the collection or null if untyped
      • doGetList

        protected List<E> doGetList​(S source)
        Description copied from class: ListProperty
        Returns a List with the current contents of the source's list property
        Overrides:
        doGetList in class ListProperty<S,​E>
        Parameters:
        source - the property source
        Returns:
        a List with the current contents of the source's list property
      • doUpdateList

        protected void doUpdateList​(S source,
                                    ListDiff<E> diff)
        Description copied from class: ListProperty
        Updates the property on the source with the specified change
        Overrides:
        doUpdateList in class ListProperty<S,​E>
        Parameters:
        source - the property source
        diff - a diff describing the change
      • observe

        public IObservableList<E> observe​(Realm realm,
                                          S source)
        Description copied from interface: IListProperty
        Returns an observable list observing this list property on the given property source
        Parameters:
        realm - the observable's realm
        source - the property source
        Returns:
        an observable list observing this list property on the given property source