/** * @param <E> * @param list * @return empty().plusAll(map) */ public static <E> MapPBag<E> from(final Collection<? extends E> list) { return HashTreePBag.<E>empty().plusAll(list); } }
/** * @param <E> * @param list * @return empty().plusAll(map) */ public static <E> MapPBag<E> from(final Collection<? extends E> list) { return HashTreePBag.<E>empty().plusAll(list); } }
@SuppressWarnings("unchecked") @Override public boolean equals(Object that) { if(!(that instanceof PBag)) return false; if(!(that instanceof MapPBag)) { // make that into a MapPBag: // TODO this is INEFFICIENT MapPBag<Object> empty = (MapPBag<Object>)this.minusAll(this); that = empty.plusAll((PBag<?>)that); } return this.map.equals( ((MapPBag<?>)that).map ); }
@SuppressWarnings("unchecked") @Override public boolean equals(Object that) { if(!(that instanceof PBag)) return false; if(!(that instanceof MapPBag)) { // make that into a MapPBag: // TODO this is INEFFICIENT MapPBag<Object> empty = (MapPBag<Object>)this.minusAll(this); that = empty.plusAll((PBag<?>)that); } return this.map.equals( ((MapPBag<?>)that).map ); }
/** * @param <E> * @param list * @return empty().plusAll(map) */ public static <E> MapPBag<E> from(final Collection<? extends E> list) { return HashTreePBag.<E>empty().plusAll(list); } }
@SuppressWarnings("unchecked") @Override public boolean equals(Object that) { if(!(that instanceof PBag)) return false; if(!(that instanceof MapPBag)) { // make that into a MapPBag: // TODO this is INEFFICIENT MapPBag<Object> empty = (MapPBag<Object>)this.minusAll(this); that = empty.plusAll((PBag<?>)that); } return this.map.equals( ((MapPBag<?>)that).map ); }
/** * @param <E> * @param list * @return empty().plusAll(map) */ public static <E> MapPBag<E> from(final Collection<? extends E> list) { return HashTreePBag.<E>empty().plusAll(list); } }
@SuppressWarnings("unchecked") @Override public boolean equals(Object that) { if (!(that instanceof PBag)) return false; if (!(that instanceof MapPBag)) { // make that into a MapPBag: // TODO this is INEFFICIENT MapPBag<Object> empty = (MapPBag<Object>) this.minusAll(this); that = empty.plusAll((PBag<?>) that); } return this.map.equals(((MapPBag<?>) that).map); }