Added getObjectCount() method