public int getPhysicalPageCount() { if ( physicalMapping == null ) { return -1; } return physicalMapping.size(); }
public int getLogicalPageCount() { if ( logicalMapping == null ) { return -1; } return logicalMapping.size(); }
private boolean isCellAreaClear( final int pos, final int colSpan ) { final int maxIdx = Math.min( pos + colSpan, rowSpans.size() ); for ( int i = pos; i < maxIdx; i++ ) { if ( rowSpans.get( tableCellPosition ) > 0 ) { return false; } } return true; }
public int[] toArray( final int fromIndex, final int toIndex ) { if ( fromIndex < 0 ) { throw new IndexOutOfBoundsException( "fromIndex = " + fromIndex ); } if ( toIndex > size() ) { throw new IndexOutOfBoundsException( "toIndex = " + toIndex ); } if ( fromIndex > toIndex ) { throw new IllegalArgumentException( "fromIndex(" + fromIndex + ") > toIndex(" + toIndex + ")" ); } if ( size == 0 ) { return IntList.EMPTY_ARRAY; } final int listSize = toIndex - fromIndex; final int[] retval = new int[listSize]; System.arraycopy( data, fromIndex, retval, 0, listSize ); return retval; }
/** * Returns the predicted size of the current group. This can return <code>null</code> if there is no prediction. * * @return */ public Integer getPredictedStateCount() { if ( groupCounts.size() == 0 ) { logger.debug( "Outside of any group: Unable to predict results" ); return null; } final Integer prediction = counts.get( keys.peek() ); return prediction; } }
protected void finishTableRowBox( final TableRowRenderBox box ) { if ( currentTable == null ) { return; } if ( currentTable.getSectionRenderBox() == null ) { return; } final IntList rowSpans = currentTable.rowSpans; int maxRowSpan = 0; for ( int i = 0; i < rowSpans.size(); i++ ) { final int value = rowSpans.get( i ); maxRowSpan = Math.max( maxRowSpan, value ); } for ( int i = 0; i < rowSpans.size(); i++ ) { final int value = rowSpans.get( i ); rowSpans.set( i, Math.max( 0, value - 1 ) ); } }
public int increaseCellPosition( final int colSpan, final int rowSpan ) { // find insert-position for the cell. This skips cells that block the location via a row-span. while ( true ) { // we are past the point of defined cells. Adding new cells is guaranteed to not have row-spans. if ( tableCellPosition >= rowSpans.size() ) { break; } if ( isCellAreaClear( tableCellPosition, colSpan ) ) { break; } tableCellPosition += 1; } final int retval = tableCellPosition; // set the cell... for ( int i = tableCellPosition; i < tableCellPosition + colSpan; i++ ) { if ( i < rowSpans.size() ) { rowSpans.set( i, Math.max( rowSpan, rowSpans.get( i ) ) ); } else { rowSpans.add( rowSpan ); } } tableCellPosition += colSpan; return retval; }
protected void finishTableSectionBox( final TableSectionRenderBox box ) { if ( currentTable == null ) { return; } if ( currentTable.getSectionRenderBox() != box ) { return; } final IntList rowSpans = currentTable.rowSpans; int missingRows = 0; for ( int i = 0; i < rowSpans.size(); i++ ) { final int value = rowSpans.get( i ); if ( missingRows < value ) { missingRows = value; } } for ( int i = 0; i < missingRows; i += 1 ) { currentTable.rowModel.addRow(); } box.getRowModel().validatePreferredSizes(); currentTable.setSectionRenderBox( null ); }