This returns <ul>
<li>-1 if the iterator hasn't been depleted</li>
<li>the total size otherwise</li>
</ul>

@return the total number of results of which this page is a subset of
428083
@Override
    public long getTotalSize() {
        if (totalSize == HasTotalSize.NOT_DEPLETED && !hasNext()) {
            totalSize = hasTotalSize == null ? HasTotalSize.NOT_DEPLETED : hasTotalSize.getTotalSize();
        }
        return totalSize;
    }
1276911
public int size() {
        int n = 0;
        int count = getRangeCount();
        for (int i = 0; i < count; ++i) {
            n += getRangeEnd(i) - getRangeStart(i) + 1;
        }
        return n + strings.size();
    }
1166799
public int size() {
        int count = 0;

        for (int i = 0, size = mScrapLength.size(); i < size; i++) {
            int val = mScrapLength.valueAt(i);
            count += val;
        }

        return count;
    }
692162
private int calcLastPage(int total, int pageSize) {
        if (total == 0) {
            return firstPage;
        } else {
            final int zeroBasedPageNo = total % pageSize > 0
                    ? total / pageSize
                    : total / pageSize - 1;
            return firstPage + zeroBasedPageNo;
        }
    }
788278
public int size() {
		int size = 0;
		for (List<V> value : map.values()) {
			size += value.size();
		}
		return size;
	}
1295214
private int calculatePageSize()
    {
        int meanColumnCount = hintStore.getMeanColumns();
        if (meanColumnCount <= 0)
            return PAGE_SIZE;

        int averageColumnSize = (int) (hintStore.getMeanRowSize() / meanColumnCount);
        if (averageColumnSize <= 0)
            return PAGE_SIZE;

        // page size of 1 does not allow actual paging b/c of >= behavior on startColumn
        return Math.max(2, Math.min(PAGE_SIZE, 4 * 1024 * 1024 / averageColumnSize));
    }
1259503
@Override
	public int remainingCapacity() {
		if (sizeLimit > 0){
			int remaining = sizeLimit - size();
			return remaining < 0 ? 0 : remaining;
		}else{
			return queue.remainingCapacity();
		}
	}
338491
function () {
            var state = this.state,
                currentPage = state.pages[state.currentPage - 1],
                rowIndex = currentPage.rowIndex,
                prevRow = state.rows[rowIndex - 1];
            return prevRow && prevRow[0] + 1 || state.currentPage;
        }
410314
public Integer getTotalPage() {
        Number i = this.totalRecord / this.pageRecord;
        return this.totalRecord % this.pageRecord == 0 ? i.intValue() : i.intValue() + 1;
    }
1112169
private long getMemoryUsage() {
    long totalPageSize = 0;
    for (MemoryBlock page : allocatedPages) {
      totalPageSize += page.size();
    }
    return ((inMemSorter == null) ? 0 : inMemSorter.getMemoryUsage()) + totalPageSize;
  }
237659
public int getSize()
	{
		int retval = head.getTagSize() + head.getHeaderSize();

		if (head.getFooter())
		{
			retval += foot.getFooterSize();
		}

		return retval;
	}
561579
public int size()
    {
        int ret = 0;
        for(Collection<T> series : data)
        {
            if(series.size() > 0)
                ++ret;
        }
        return ret;

    }
60654
public int dataAvailable() {
        if (readBuffer.position() < fillBuffer.position()) {
            return readBuffer.remaining();
        } else if (readBuffer.position() > fillBuffer.position()) {
            return capacity - fillBuffer.remaining();
        } else {
            if (readBuffer.hasRemaining()) {
                return readBuffer.remaining() + fillBuffer.position();
            } else {
                return 0;
            }
        }
    }
1056213
public int size() {
        int ele, count;

        count = 0;
        for (ele = first(); ele != -1; ele = next(ele)) {
            count++;
        }
        return count;
    }
121374
@Override public int getItemCount() {
    int size = items.size();
    if (hasHeader()) {
      size++;
    }
    if (hasFooter()) {
      size++;
    }
    return size;
  }
812289
public int size() {
        int retval=0;
        for(long i=low, num_iterations=0; i < high && num_iterations < buffer.length; i++, num_iterations++) {
            int index=index(i);
            if(buffer[index] != null)
                retval++;
        }
        return retval;
    }
247904
public int getCurrentPage() {
        int currentPage = 1;
        int count = mScrollable.getScrollingItemsCount();
        if (mSupportScrollByPage && mCurrentItemIndex >= 0 &&
                mCurrentItemIndex < count) {
            currentPage = (Math.min(mCurrentItemIndex + mPageSize - 1, count - 1)/mPageSize);
        }
        return currentPage;
    }