/** * @param <E> * @param list * @return empty().plusAll(list) */ @SuppressWarnings("unchecked") public static <E> TreePVector<E> from(final Collection<? extends E> list) { if(list instanceof TreePVector) return (TreePVector<E>)list; //(actually we only know it's TreePVector<? extends E>) // but that's good enough for an immutable // (i.e. we can't mess someone else up by adding the wrong type to it) return TreePVector.<E>empty().plusAll(list); }
/** * @param <E> * @param list * @return empty().plusAll(list) */ @SuppressWarnings("unchecked") public static <E> TreePVector<E> from(final Collection<? extends E> list) { if(list instanceof TreePVector) return (TreePVector<E>)list; //(actually we only know it's TreePVector<? extends E>) // but that's good enough for an immutable // (i.e. we can't mess someone else up by adding the wrong type to it) return TreePVector.<E>empty().plusAll(list); }
/** * @param <E> * @param list * @return empty().plusAll(list) */ @SuppressWarnings("unchecked") public static <E> TreePVector<E> from(final Collection<? extends E> list) { if (list instanceof TreePVector) return (TreePVector<E>) list; //(actually we only know it's TreePVector<? extends E>) // but that's good enough for an immutable // (i.e. we can't mess someone else up by adding the wrong type to it) return TreePVector.<E>empty().plusAll(list); }
/** * @param <E> * @param list * @return empty().plusAll(list) */ @SuppressWarnings("unchecked") public static <E> TreePVector<E> from(final Collection<? extends E> list) { if(list instanceof TreePVector) return (TreePVector<E>)list; //(actually we only know it's TreePVector<? extends E>) // but that's good enough for an immutable // (i.e. we can't mess someone else up by adding the wrong type to it) return TreePVector.<E>empty().plusAll(list); }