This method of the ElementCollection class retrieves the number of items in the collection.
public int getLength();
Returns the item count.