@SuppressWarnings("unchecked") public Collection<T> getAll() { return m_impl.values(); }
public Collection<V> values() { return m_impl.values(); }
public int size() { // olala this is tricky stuff: the Commons MultiMap size is the number of entries in the map // but what we really want is the total number of symbols in our symbol maps return m_impl.values().size(); }
@SuppressWarnings("unchecked") public Iterator<T> iterator() { return m_impl.values().iterator(); }
for (Object o : roles.values()) { RoleDescriptor rd = (RoleDescriptor) o; if (rd.within.is(observable)) {
public static void removeRolesFor(INamespace namespace) { List<Pair<IConcept, RoleDescriptor>> toRemove = new ArrayList<>(); for (Object o : roles.values()) { RoleDescriptor rd = (RoleDescriptor) o; if (rd.namespaceId.equals(namespace.getId())) { toRemove.add(new Pair<>(rd.role, rd)); } } for (Pair<IConcept, RoleDescriptor> r : toRemove) { roles.remove(r.getFirst(), r.getSecond()); } }
private Map<Entity, BigDecimal> getProductsAndQuantitiesMap(final MultiMap groupedProductQuantities, final Entity order) { Map<Entity, BigDecimal> map = new HashMap<Entity, BigDecimal>(); for (Object pcq : groupedProductQuantities.values()) { Entity product = ((Entity) pcq).getBelongsToField(ProductionCountingQuantityFields.PRODUCT); BigDecimal quantityTaken = getProductQuantityTakenForOrder(product.getId(), order.getId()); BigDecimal quantityUsed = getProductQuantityUsedInOrder(product.getId(), order.getId()); BigDecimal diff = quantityTaken.subtract(quantityUsed); if (diff.compareTo(BigDecimal.ZERO) > 0) { map.put(product, diff); } } return map; }