package configuration;

/**
 * A triple (hookName, component, attributes). It is used in two situations. 
 * <OL><LI> to represent components attached to local hooks and </LI>
 *     <LI> to represent client hooks to which this component is attached.</LI> 
 * </OL>
 * @author  Fabio Kon
 * @version 0.2
 * @see     ComponentConfigurator
 */

public class DependencySpecification {
/**
 * The name of the hook.
 */
    public String hook_;
/**
 * The component that is attached to the hook or the client that contains the
 * hook.  
 */
    public ComponentConfigurator component_;

/**
 * The attributes (or properties) associated with the hook.
 */
    public DependencyAttributes attributes_;
    
/**
 * Creates a new DependencySpecification with the given values.
 * Note that it does not create copies of the objects passed as parameters, it
 * just stores references to them.
 */
    public DependencySpecification (String hook, ComponentConfigurator component, 
				    DependencyAttributes attributes)
    {
        hook_ = hook;
        component_ = component;
	attributes_ = attributes;
    }

/**
 * Compares this DependencySpecification with hs. 
 * @return true if the hook name and component of the DependencySpecification 
 * point to the same objects as the member variables of hs. 
 * Otherwise, returns false.
 */
    // This method is used by the removeElement method called in
    // unregisterClient.
    public boolean equals (DependencySpecification hs)
    {
        return (hs.hook_.equals(hook_) & hs.component_ == component_);
    }

// /**
//  * Sets attributes of this dependency
//  */
//     public void attributes (DependencyAttributes attributes)
//   {
//     attributes_ = attributes;
//   }

// /**
//  * Accessor for the attributes of this dependency.
//  * Note that it returns a reference to the attributes and not a copy of them.
//  * @return a vector containing the attributes of this dependency. 
//  */
//     public DependencyAttributes attributes ()
//   {
//     return attributes_;
//   }

        

    
    
};

