@Override
        public void processListener(FacesListener listener) {
            UITabPanel owner = (UITabPanel) getComponent();

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

            try {
                owner.captureScopeValues();
                if (_index != -1) {
                    // calculate count for RepeatStatus
                    _count = calculateCountForIndex(_index);
                }
                owner.setIndex(_index);
                if (owner.isIndexAvailable()) {
                    _target.processListener(listener);
                }
            }
            finally {
                // restore the previous count, index and scope values
                owner._count = prevCount;
                owner.setIndex(prevIndex);
                owner.restoreScopeValues();
            }
        }
Calculates the count value for the given index.

@param index

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