/** Initials.java models a group of initials.
 * @author Joel Adams, for Alice+Java.
 */

import java.util.StringTokenizer;

public class Initials {
	
	/** constructor computes a person's initials, given their name.
	 * @param name, a String
	 * @return the initials for name
	 */
	public Initials(String name) {
		myName = name;
		myInitials = "";
		StringTokenizer names = new StringTokenizer(name);
		while ( names.hasMoreTokens() ) {
			String word = names.nextToken();
			myInitials += word.charAt(0);
		}
	}
	
	public String getInitials() { return myInitials; }
	public String getName() { return myName; }
	
	private String myName;
	private String myInitials;
}
