/** * File: Supplier.java * Description: * Took out "dominates" and added precedence * for both Supplier and ConcreteSupplier * **/ package lawOfDemeter; import java.util.*; /** * The Supplier class is a super class for the bin aspects. * It provides common functionality around a HashMap (targets) * that keeps track of the preferred supplier objects stored in the * various bins. * * @author David H. Lorenz * @author Modifications made by Paul Freeman */ abstract aspect Supplier { declare precedence : Supplier, Checker; protected final static String argument = " OK--Argument"; protected final static String local = " OK--New, local, or static"; protected final static String direct = " OK--Instance variable"; protected final static String receiver = " OK--Receiver"; protected IdentityHashMap targets=new IdentityHashMap(); private static Vector suppliers = new Vector(); // used to hold all the // suppliers available to // the checker aspect /** * Adds the target as the key and the String i as the value to the * container of targets in this supplier. * * @param target * @param i */ void add(Object target,String i) { if(target != null){ targets.put(target,i); } } /** * Adds all of the targets in the target list to the container of targets * with the target as the key and the String i as the value. * * @param targetlist * @param i */ void addAll(Object[] targetlist,String i) { for (int k=0; k