import java.util.Map;
import java.util.Set;
import java.net.URL;

/**
 * A webpage index entry that stores the address, links, 
 * keywords and keyword frequency of this webpage. An 
 * entry must have at least one keyword. 
 * @author CIS-121 Staff
 */

public interface WebpageIndexEntryI {
	/**
	 * Returns the address of this page.
	 * @return the address of this page.
	 */
	public URL getAddress();
	
	/**
	 * Returns a set of links that this page links to. 
	 * It may be empty if this page does not link to 
	 * anything but it should not be null.
	 * @return The set of links that this page links to.
	 */
	public Set<URL> getLinks();
	
	/**
	 * Returns a map where the keys are the frequency 
	 * and the values are the set of keywords that appear on this 
	 * page with that frequency.
	 *@return A frequency map of keywords 
	 */
	public Map<Integer, Set<String>> getFrequencyMap();
	
	/**
	 * Sets the address that this entry represents.
	 * @param url The full address of this page.
	 */
	public void setAddress(URL url);
	
	/**
	 * Sets the links that this page links to. 
	 * @param links the set of links that this
	 * page links to. 
	 */
	public void addLinks(Set<URL> links);
	
	/**
	 * Adds a {@code keyword} to this entry. A 
	 * WebpageIndexEntryI should keep track of the 
	 * frequency with which it has seen a keyword. 
	 * Therefore  a call to addKeyword should increase
	 * the frequency count for {@code keyword} if {@code keyword}  
	 * has already been seen by this entry.
	 * @param keyword the new keyword.
	 */
	public void addKeyword(String keyword);
}
