public void endChild( final RenderBox box ) { if ( currentNode != null ) { if ( orphanCount < orphans && orphans > 0 ) { orphanSize.add( box ); box.setRestrictFinishedClearOut( RenderBox.RestrictFinishClearOut.LEAF ); } orphanCount += 1; currentNode = null; } if ( parent != null ) { parent.endChild( box ); } }
public void endChild( final RenderBox box ) { if ( currentNode != null ) { if ( widowCount < widows && widows > 0 ) { widowSize.add( box ); box.setRestrictFinishedClearOut( RenderBox.RestrictFinishClearOut.LEAF ); } widowCount += 1; currentNode = null; } if ( parent != null ) { parent.endChild( box ); } }
public void registerFinishedNode( final FinishedRenderNode box ) { if ( widowCount < widows && widows > 0 ) { widowSize.add( box ); box.getParent().setRestrictFinishedClearOut( RenderBox.RestrictFinishClearOut.RESTRICTED ); } widowCount += box.getWidowLeafCount(); currentNode = null; if ( parent != null ) { parent.registerFinishedNode( box ); } }
public void registerFinishedNode( final FinishedRenderNode box ) { if ( orphanCount < orphans && orphans > 0 ) { orphanSize.add( box ); box.getParent().setRestrictFinishedClearOut( RenderBox.RestrictFinishClearOut.RESTRICTED ); } orphanCount += box.getOrphanLeafCount(); currentNode = null; if ( parent != null ) { parent.registerFinishedNode( box ); } }
public void testReplaceFirst() { final RingBuffer<Integer> tc = new RingBuffer<Integer>( 3 ); tc.replaceLastAdded( 10 ); assertEquals( 10, (int) tc.getFirstValue() ); assertEquals( 10, (int) tc.getLastValue() ); tc.add( 10 ); tc.add( 20 ); tc.add( 30 ); tc.add( 40 ); assertEquals( 40, (int) tc.getLastValue() ); assertEquals( 20, (int) tc.getFirstValue() ); }
public void testReplace() { final RingBuffer<Integer> tc = new RingBuffer<Integer>( 3 ); tc.add( 10 ); tc.add( 20 ); tc.add( 30 ); assertEquals( 30, (int) tc.getLastValue() ); assertEquals( 10, (int) tc.getFirstValue() ); tc.replaceLastAdded( 40 ); assertEquals( 40, (int) tc.getLastValue() ); assertEquals( 10, (int) tc.getFirstValue() ); tc.add( 50 ); assertEquals( 50, (int) tc.getLastValue() ); assertEquals( 20, (int) tc.getFirstValue() ); }