@Test public void testSetElementAt() { ItemBand itemBand = mock( ItemBand.class ); NoDataBand band = mock( NoDataBand.class ); DetailsHeader header = mock( DetailsHeader.class ); DetailsFooter footer = mock( DetailsFooter.class ); body.setElementAt( 0, header ); body.setElementAt( 1, itemBand ); body.setElementAt( 2, band ); body.setElementAt( 3, footer ); assertThat( body.getDetailsHeader(), is( equalTo( header ) ) ); assertThat( body.getItemBand(), is( equalTo( itemBand ) ) ); assertThat( body.getNoDataBand(), is( equalTo( band ) ) ); assertThat( body.getDetailsFooter(), is( equalTo( footer ) ) ); }
public void setElementAt( final int position, final Element element ) { switch ( position ) { case 0: setDetailsHeader( (DetailsHeader) element ); break; case 1: setItemBand( (ItemBand) element ); break; case 2: setNoDataBand( (NoDataBand) element ); break; case 3: setDetailsFooter( (DetailsFooter) element ); break; default: throw new IndexOutOfBoundsException(); } }
GroupDataBody extends GroupBody { public void setElementAt( final int position, final Element element ) { switch ( position ) { case 0: setDetailsHeader( (DetailsHeader) element ); break; case 1: setItemBand( (ItemBand) element ); break; case 2: setNoDataBand( (NoDataBand) element ); break; case 3: setDetailsFooter( (DetailsFooter) element ); break; default: throw new IndexOutOfBoundsException(); } } }
GroupDataBody extends GroupBody { public void setElementAt( final int position, final Element element ) { switch ( position ) { case 0: setDetailsHeader( (DetailsHeader) element ); break; case 1: setItemBand( (ItemBand) element ); break; case 2: setNoDataBand( (NoDataBand) element ); break; case 3: setDetailsFooter( (DetailsFooter) element ); break; default: throw new IndexOutOfBoundsException(); } } GroupDataBody(); }
GroupDataBody extends GroupBody { public void setElementAt( final int position, final Element element ) { switch ( position ) { case 0: setDetailsHeader( (DetailsHeader) element ); break; case 1: setItemBand( (ItemBand) element ); break; case 2: setNoDataBand( (NoDataBand) element ); break; case 3: setDetailsFooter( (DetailsFooter) element ); break; default: throw new IndexOutOfBoundsException(); } } GroupDataBody(); Group getGroup(); NoDataBand getNoDataBand(); void setNoDataBand( final NoDataBand noDataBand ); ItemBand getItemBand(); void setItemBand( final ItemBand itemBand ); DetailsHeader getDetailsHeader(); void setDetailsHeader( final DetailsHeader detailsHeader ); DetailsFooter getDetailsFooter(); void setDetailsFooter( final DetailsFooter detailsFooter ); int getElementCount(); Element getElement( final int index ); void setElementAt( final int position, final Element element ); GroupDataBody clone(); GroupDataBody derive( final boolean preserveElementInstanceIds ); }
GroupDataBody extends GroupBody { public void setElementAt( final int position, final Element element ) { switch ( position ) { case 0: setDetailsHeader( (DetailsHeader) element ); break; case 1: setItemBand( (ItemBand) element ); break; case 2: setNoDataBand( (NoDataBand) element ); break; case 3: setDetailsFooter( (DetailsFooter) element ); break; default: throw new IndexOutOfBoundsException(); } } GroupDataBody(); Group getGroup(); NoDataBand getNoDataBand(); void setNoDataBand( final NoDataBand noDataBand ); ItemBand getItemBand(); void setItemBand( final ItemBand itemBand ); DetailsHeader getDetailsHeader(); void setDetailsHeader( final DetailsHeader detailsHeader ); DetailsFooter getDetailsFooter(); void setDetailsFooter( final DetailsFooter detailsFooter ); int getElementCount(); Element getElement( final int index ); void setElementAt( final int position, final Element element ); GroupDataBody clone(); GroupDataBody derive( final boolean preserveElementInstanceIds );  }