@Test void testGetJoinedHeaderFromSectionHasMultipleSentenceHeader() { List<Sentence> headers = new ArrayList<>(); headers.add(new Sentence("header1.", 0)); headers.add(new Sentence("header2.", 0)); Section section = new Section(0, headers); assertEquals("header1. header2.", section.getJoinedHeaderContents().getContent()); assertEquals(0, section.getJoinedHeaderContents().getLineNumber()); }
public Sentence getJoinedHeaderContents() { StringBuilder joinedHeader = new StringBuilder(); int lineNum = 0; if (headerContent.size() > 0) { lineNum = headerContent.get(0).getLineNumber(); } int i = 0; for (Sentence header : headerContent) { if (i != 0) { joinedHeader.append(" "); } joinedHeader.append(header.getContent()); i++; } return new Sentence(joinedHeader.toString(), lineNum); }
Section { public Sentence getJoinedHeaderContents() { StringBuilder joinedHeader = new StringBuilder(); int lineNum = 0; if (headerContent.size() > 0) { lineNum = headerContent.get(0).getLineNumber(); } int i = 0; for (Sentence header : headerContent) { if (i != 0) { joinedHeader.append(" "); } joinedHeader.append(header.getContent()); i++; } return new Sentence(joinedHeader.toString(), lineNum); } }
Section { public Sentence getJoinedHeaderContents() { StringBuilder joinedHeader = new StringBuilder(); int lineNum = 0; if (headerContent.size() > 0) { lineNum = headerContent.get(0).getLineNumber(); } int i = 0; for (Sentence header : headerContent) { if (i != 0) { joinedHeader.append(" "); } joinedHeader.append(header.getContent()); i++; } return new Sentence(joinedHeader.toString(), lineNum); } Section(int sectionLevel);  Section(int sectionLevel, List<Sentence> header);  Section(int sectionLevel, String headerString); }
Section { public Sentence getJoinedHeaderContents() { StringBuilder joinedHeader = new StringBuilder(); int lineNum = 0; if (headerContent.size() > 0) { lineNum = headerContent.get(0).getLineNumber(); } int i = 0; for (Sentence header : headerContent) { if (i != 0) { joinedHeader.append(" "); } joinedHeader.append(header.getContent()); i++; } return new Sentence(joinedHeader.toString(), lineNum); } Section(int sectionLevel);  Section(int sectionLevel, List<Sentence> header);  Section(int sectionLevel, String headerString); void appendSubSection(Section section); Section getSubSection(int id); Section getParentSection(); void setParentSection(Section parentSection); int getNumberOfSubsections(); int getLevel(); void setLevel(int sectionLevel); List<Sentence> getHeaderContents(); Sentence getHeaderContent(int id); Sentence getJoinedHeaderContents(); int getHeaderContentsListSize(); List<Paragraph> getParagraphs(); Paragraph getParagraph(int id); void appendParagraph(Paragraph paragraph); void appendListBlock(); void appendListElement(int listLevel, List<Sentence> contents); int getNumberOfLists(); ListBlock getListBlock(int id); List<ListBlock> getListBlocks(); int getNumberOfParagraphs(); }
Section { public Sentence getJoinedHeaderContents() { StringBuilder joinedHeader = new StringBuilder(); int lineNum = 0; if (headerContent.size() > 0) { lineNum = headerContent.get(0).getLineNumber(); } int i = 0; for (Sentence header : headerContent) { if (i != 0) { joinedHeader.append(" "); } joinedHeader.append(header.getContent()); i++; } return new Sentence(joinedHeader.toString(), lineNum); } Section(int sectionLevel);  Section(int sectionLevel, List<Sentence> header);  Section(int sectionLevel, String headerString); void appendSubSection(Section section); Section getSubSection(int id); Section getParentSection(); void setParentSection(Section parentSection); int getNumberOfSubsections(); int getLevel(); void setLevel(int sectionLevel); List<Sentence> getHeaderContents(); Sentence getHeaderContent(int id); Sentence getJoinedHeaderContents(); int getHeaderContentsListSize(); List<Paragraph> getParagraphs(); Paragraph getParagraph(int id); void appendParagraph(Paragraph paragraph); void appendListBlock(); void appendListElement(int listLevel, List<Sentence> contents); int getNumberOfLists(); ListBlock getListBlock(int id); List<ListBlock> getListBlocks(); int getNumberOfParagraphs();  }