package keris.lang;

import java.util.*;


public abstract module ATTRIBUTES {
    
    /** a hashtable of all attributed objects
     */
    private Map attributes = new WeakHashMap();
    
    /** the root interface for Attributes
     */
    public interface AttribConstr {
        AttribConstr(Object obj);
    }
    
    /** the attribute class
     */
    public class Attribute implements AttribConstr;
    
    /** get the attributes of an object
     */
    public synchronized Attribute get(Object obj) {
        Attribute a = (Attribute)attributes.get(obj);
        if (a == null)
            attributes.put(obj, a = new Attribute(obj));
        return a;
    }
}
