The number of itemId in your list will be the same as the number of items in your list:
int itemCount = list.size();
However, if you want to count the number of unique itemIds (per @pst), you must use a set to track them.
Set<String> itemIds = new HashSet<String>();
Mark Peters Sep 13 '10 at 20:43 2010-09-13 20:43
source share