/** * Copies all the distance functors from <code>from</code> attribute type to <code>to</code> * attribute type. * * @param to the attribute type to get the copies * @param from the attribute type to receive the distance functor references */ public static final void useSameDistances(String to, String from) { check(from); Map<String, Distance> fromValues = distanceMap.get(from); Map<String, Distance> toValues = distanceMap.get(to); if (fromValues != null) { if (toValues != null) { toValues.putAll(fromValues); } else { toValues = new HashMap<String, Distance>(); toValues.putAll(fromValues); distanceMap.put(to, toValues); } } }