Class WritableList<E>

    • Constructor Detail

      • WritableList

        public WritableList()
        Creates an empty writable list in the default realm with a null element type.
      • WritableList

        public WritableList​(Realm realm)
        Creates an empty writable list with a null element type.
        Parameters:
        realm - the observable's realm
      • WritableList

        public WritableList​(List<E> toWrap,
                            Object elementType)
        Constructs a new instance with the default realm. Note that for backwards compatibility reasons, the contents of the created WritableList will change with the contents of the given list. If this is not desired, WritableList(Collection, Object) should be used by casting the first argument to Collection.
        Parameters:
        toWrap - The java.util.List to wrap
        elementType - can be null
      • WritableList

        public WritableList​(Collection<E> collection,
                            Object elementType)
        Constructs a new instance in the default realm containing the elements of the given collection. Changes to the given collection after calling this method do not affect the contents of the created WritableList.
        Parameters:
        collection - the collection to copy
        elementType - can be null
        Since:
        1.2
      • WritableList

        public WritableList​(Realm realm,
                            List<E> toWrap,
                            Object elementType)
        Creates a writable list containing elements of the given type, wrapping an existing client-supplied list. Note that for backwards compatibility reasons, the contents of the created WritableList will change with the contents of the given list. If this is not desired, WritableList(Realm, Collection, Object) should be used by casting the second argument to Collection.
        Parameters:
        realm - the observable's realm
        toWrap - The java.util.List to wrap
        elementType - can be null
      • WritableList

        public WritableList​(Realm realm,
                            Collection<E> collection,
                            Object elementType)
        Constructs a new instance in the default realm containing the elements of the given collection. Changes to the given collection after calling this method do not affect the contents of the created WritableList.
        Parameters:
        realm - the observable's realm
        collection - the collection to copy
        elementType - can be null
        Since:
        1.2