1 29 30 package com.caucho.xtpdoc; 31 32 import java.io.IOException ; 33 import java.io.PrintWriter ; 34 import java.util.ArrayList ; 35 36 public class Chapter { 37 private String _title; 38 private ArrayList <ChapterSection> _sections = new ArrayList <ChapterSection>(); 39 40 public void setTitle(String title) 41 { 42 _title = title; 43 } 44 45 public void addLinkedSection(LinkedChapterSection section) 46 { 47 _sections.add(section); 48 } 49 50 public void addEnclosingSection(EnclosingChapterSection section) 51 { 52 _sections.add(section); 53 } 54 55 public void writeLaTeX(PrintWriter out) 56 throws IOException 57 { 58 out.println("\\chapter{" + _title + "}"); 59 60 for (ChapterSection section : _sections) 61 section.writeLaTeX(out); 62 } 63 } 64 | Popular Tags |