import java.util.HashMap;
import java.util.Map;

/**
 * Trivial example of using a map.
 * Maps the argument to the length of the argument
 * 
 * @author CSCI209
 *
 */
public class MapExample {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Map<String, Integer> argToLength = new HashMap<>();

		for (String arg : args) {
			// if there are duplicate arguments, this will write over that entry in the map.
			argToLength.put(arg, arg.length());
		}
		
		// display the results
		System.out.println("Arguments' Lengths: ");
		for( String arg : argToLength.keySet() ) {
			System.out.println(arg + " --> " + argToLength.get(arg));
		}

	}

}
