The getCount method of the CookieDictionary class returns an integer that is the number of items in the CookieDictionary.
public int getCount();