Retrieves the ending row index for the current page. Will always return the row count minus 1 for tables which
are not paginated.

@return the starting row index for the current page.
974584
private int getCurrentPageEndRow() {
		TableDataModel model = getDataModel();
		int rowsPerPage = getRowsPerPage();
		int endRow = model.getRowCount() - 1;

		if (getPaginationMode() != PaginationMode.NONE) {
			if (model instanceof TreeTableDataModel) {
				// For tree tables, pagination only occurs on first-level nodes (ie. those
				// underneath the root node), however they might not be consecutively
				// numbered. Therefore, the start and end row indices need to be adjusted.
				TreeTableDataModel treeModel = (TreeTableDataModel) model;
				TreeNode root = treeModel.getNodeAtLine(0).getRoot();

				int endNode = Math.min(root.getChildCount() - 1,
						(getCurrentPage() + 1) * rowsPerPage - 1);

				endRow = ((TableTreeNode) root.getChildAt(endNode)).getRowIndex() - 1 // -1 as the root is not included in the table
						+ ((TableTreeNode) root.getChildAt(endNode)).getNodeCount();
			} else {
				endRow = Math.min(model.getRowCount() - 1, (getCurrentPage() + 1) * rowsPerPage - 1);
			}
		}

		return endRow;
	}
17423
protected function calculatePageRowNumberForLastLink()
    {
        $mod = $this->totalRows % $this->limit;

        return ($this->totalRows - $mod ) - ($mod == 0 ? $this->limit : 0);
    }
408016
public function getCurrentRow()
        {
            if (isset($this->rows[($this->int_ptr - 1)])) {
                return $this->rows[($this->int_ptr - 1)];
            }
            return null;
        }
93638
public int getRowWidth() {

        int overallWidth = 0;
        for (int i = 0; i < data.length; i++) {
            overallWidth += getTable().getColumnWidth(i);
        }
        return overallWidth;
    }
1119796
private int indexRows(TableIndex tableIndex, FeatureResultSet resultSet) {

		int count = -1;

		try {
			while ((progress == null || progress.isActive())
					&& resultSet.moveToNext()) {
				if (count < 0) {
					count++;
				}
				try {
					FeatureRow row = resultSet.getRow();
					boolean indexed = index(tableIndex, row.getId(),
							row.getGeometry());
					if (indexed) {
						count++;
					}
					if (progress != null) {
						progress.addProgress(1);
					}
				} catch (Exception e) {
					log.log(Level.SEVERE, "Failed to index feature. Table: "
							+ tableIndex.getTableName() + ", Position: "
							+ resultSet.getPosition(), e);
				}
			}
		} finally {
			resultSet.close();
		}

		return count;
	}
519734
public final int pageY() {
    if (getTouches() != null &&  getTouches().length() > 0) {
      return getTouches().get(0).getPageY();
    } else {
      return getClientY() + GQuery.document.getScrollTop();
    }
  }
1012528
public int getPageNumber() {
    if (DataTable_Type.featOkTst && ((DataTable_Type)jcasType).casFeat_pageNumber == null)
      jcasType.jcas.throwFeatMissing("pageNumber", "ch.epfl.bbp.uima.types.DataTable");
    return jcasType.ll_cas.ll_getIntValue(addr, ((DataTable_Type)jcasType).casFeatCode_pageNumber);}
20143
protected static function getPageRange()
    {
        $currentPage = static::$pagination->getPage();
        $pageCount = static::$pagination->getPageCount();
        $beginPage = max(0, $currentPage - (int) (static::$params['maxButtonCount'] / 2));
        if (($endPage = $beginPage + static::$params['maxButtonCount'] - 1) >= $pageCount) {
            $endPage = $pageCount - 1;
            $beginPage = max(0, $endPage - static::$params['maxButtonCount'] + 1);
        }
        return [$beginPage, $endPage];
    }
1348718
public long lastIndex() {
    assertSegmentOpen();
    return !isEmpty() ? offsetIndex.lastOffset() + descriptor.index() + skip : descriptor.index() - 1;
  }
272757
@Override
  public IndexedInts getRow()
  {
    final IndexedInts row = selector.getRow();

    if (row.size() == 1) {
      if (nullAdjustment == 0) {
        return row;
      } else {
        nullAdjustedRow.setValue(row.get(0) + nullAdjustment);
        return nullAdjustedRow;
      }
    } else {
      // Can't handle non-singly-valued rows in expressions.
      // Treat them as nulls until we think of something better to do.
      return ZeroIndexedInts.instance();
    }
  }
1194474
public int getRowCount() {
    if (DataTable_Type.featOkTst && ((DataTable_Type)jcasType).casFeat_rowCount == null)
      jcasType.jcas.throwFeatMissing("rowCount", "ch.epfl.bbp.uima.types.DataTable");
    return jcasType.ll_cas.ll_getIntValue(addr, ((DataTable_Type)jcasType).casFeatCode_rowCount);}
235921
private int getTableIndex(String tableName) {

        int index;

        // System.out.println("begin searching for "+tableName);
        for (index = 0; index < vHoldTableNames.size(); index++) {

            // System.out.println("in getTableIndex searching for "+tableName+", index: "+index);
            if (tableName.equals((String) vHoldTableNames.elementAt(index))) {
                return index;
            }    // end of if (tableName.equals(vHoldTableNames.elementAt(index)))
        }        // end of for (index = 0; index < vHoldTableNames.size(); index ++)

        return -1;
    }
489582
def end_index(self):
        """"""
        paginator = self.paginator
        # Special case for the last page because there can be orphans.
        if self.number == paginator.num_pages:
            return paginator.count
        return (self.number - 1) * paginator.per_page + paginator.first_page
1130803
public int getRows() {
        return (java.lang.Integer) getStateHelper().eval(PropertyKeys.rows, Integer.MIN_VALUE);

    }
194285
private List<Integer> getRowIds(final int startIndex, final int endIndex) {
		// If the table is sorted, we may require a mapping for table row index <--> data model index.
		int[] rowIndexMapping = getComponentModel().rowIndexMapping;

		// Check if sort mapping needs updating
		if (isSorted() && rowIndexMapping != null && rowIndexMapping.length != getDataModel().
				getRowCount()) {
			rowIndexMapping = getDataModel().sort(getSortColumnIndex(), isSortAscending());
			getOrCreateComponentModel().rowIndexMapping = rowIndexMapping;
		}

		if (rowIndexMapping == null) {
			// No mapping, return from startIndex to endIndex
			return new RowIdList(startIndex, endIndex);
		} else {
			List<Integer> rowIds = new ArrayList<>(endIndex - startIndex + 1);

			for (int i = startIndex; i <= endIndex; i++) {
				rowIds.add(rowIndexMapping[i]);
			}

			return rowIds;
		}

	}
881114
public int getValueIndex() {

        int result = 0;
        Node previousSibling = getElement().getPreviousSibling();
        while (previousSibling != null) {
            result++;
            previousSibling = previousSibling.getPreviousSibling();
        }
        return result;
    }
724384
public function getPagesRange()
    {
        $pageRange  = $this->getPageRange();
        $pageNumber = $this->getCurrentPageNumber();
        $pageCount  = $this->getNumberOfPages();

        if ($pageRange > $pageCount) {
            $pageRange = $pageCount;
        }

        $delta = ceil($pageRange / 2 );

        if ($pageNumber - $delta > $pageCount - $pageRange) {
            $lowerBound = $pageCount - $pageRange + 1;
            $upperBound = $pageCount;
        } else {
            if ($pageNumber - $delta < 0) {
                $delta = $pageNumber;
            }

            $offset     = $pageNumber - $delta;
            $lowerBound = $offset + 1;
            $upperBound = $offset + $pageRange;
        }

        $pages = array();
        for ($pageNumber = $lowerBound; $pageNumber <= $upperBound; $pageNumber++) {
            $pages[$pageNumber] = $pageNumber;
        }

        return $pages;
    }