@Override
    public void broadcast(FacesEvent event) throws AbortProcessingException {
        if (!isRepeating()) {
            super.broadcast(event);
        }
        else {
            if (event instanceof IndexedEvent) {
                IndexedEvent idxEvent = (IndexedEvent) event;

                // safe the current index, count aside
                final int prevIndex = _index;
                final int prevCount = _count;

                try {
                    captureScopeValues();
                    if (idxEvent.getIndex() != -1) {
                        // calculate count for RepeatStatus
                        _count = calculateCountForIndex(idxEvent.getIndex());
                    }
                    setIndex(idxEvent.getIndex());
                    if (isIndexAvailable()) {
                        // get the target FacesEvent
                        FacesEvent target = idxEvent.getTarget();
                        FacesContext facesContext = getFacesContext();

                        // get the component associated with the target event and push
                        // it and its composite component parent, if available, to the
                        // component stack to have them available while processing the
                        // event (see also UIViewRoot._broadcastAll()).
                        UIComponent targetComponent = target.getComponent();
                        UIComponent compositeParent = UIComponent
                                .getCompositeComponentParent(targetComponent);
                        if (compositeParent != null) {
                            pushComponentToEL(facesContext, compositeParent);
                        }
                        pushComponentToEL(facesContext, targetComponent);

                        try {
                            // actual event broadcasting
                            targetComponent.broadcast(target);
                        }
                        finally {
                            // remove the components from the stack again
                            popComponentFromEL(facesContext);
                            if (compositeParent != null) {
                                popComponentFromEL(facesContext);
                            }
                        }
                    }
                }
                finally {
                    // restore the previous count, index and scope values
                    _count = prevCount;
                    setIndex(prevIndex);
                    restoreScopeValues();
                }
            }
            else {
                super.broadcast(event);
            }
        }
    }
Calculates the count value for the given index.

@param index

@return
primefaces/src/main/java/org/primefaces/component/api/UITabPanel.java