/**
 * 
 */

/**
 * A SizableString implements the Sizable interface
 * and provides sizing methods for Strings.
 * 
 * @author Nancy Harris
 * @version V1 4/22/2013
 */
public class SizableString implements Sizable {
	
	private String text;
	
	/**
	 * Constructor to make a SizableString.
	 * 
	 * @param value The String value to use
	 */
	public SizableString(String value)
	{
		this.text = value;
	}
	/** 
	 * calcSize returns the size of the String value
	 * @return int The size of the String in characters
	 */
	public int calcSize() {
		int count;
		
		if (this.text != null)
			count = this.text.length();
		else
			count = 0;
		
		return count;
	}

	/* showValue provides a description for this 
	 * SizableString
	 * @return a string description
	 */
	@Override
	public String showValue() {
		
		return this.text + ": " + calcSize();
	}

}
