Package br.com.caelum.tubaina

Source Code of br.com.caelum.tubaina.Section

package br.com.caelum.tubaina;

import java.util.List;

import br.com.caelum.tubaina.util.TitleShortener;
import br.com.caelum.tubaina.util.TitleSlug;

public class Section {

  private static int COUNT = 1;
 
  private List<Chunk> chunks;

  private String title;
 
  private int sectionNumber;

    private String titleSlug;

  public Section(String title, List<Chunk> chunks) {
    this.title = title;
    this.titleSlug = new TitleSlug(title).toString();
    this.chunks = chunks;
    this.sectionNumber = COUNT;
    COUNT++;
  }

  public String getTitle() {
    return title;
  }
 
  public List<Chunk> getChunks() {
    return chunks;
  }
 
  public static int getSectionsCount() {
    return COUNT;
  }
 
  public int getSectionNumber() {
        return sectionNumber;
    }
 
  public String getTitleSlug() {
        return titleSlug;
    }
 
  public boolean isIntro() {
      return title == null;
  }
 
  public String getShortTitle(int maxLength) {
      return new TitleShortener(maxLength).shortenTitle(title);
    }
 
}
TOP

Related Classes of br.com.caelum.tubaina.Section

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.