Package com.independentsoft.office.odf.fields

# Class Chapter

java.lang.Object
com.independentsoft.office.odf.fields.Field
com.independentsoft.office.odf.fields.Chapter

All Implemented Interfaces:
  `IContentElement`, `IParagraphContent`

public class Chapter extends Field
Represents a field that displays one of the following: - The name of the current chapter. - The number of the current chapter. - Both the name and number of the current chapter. If this element is placed inside a header or footer, it displays the current chapter name or number on every page.

- ## Field Summary

  ### Fields inherited from class com.independentsoft.office.odf.fields.Field

  `parent`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Chapter()`
  Initializes a new instance of the Chapter class.
  `Chapter​(InternalXMLStreamReader reader)`
  Instantiates a new chapter.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Chapter`
  `clone()`
  Creates a new object that is a deep copy of the current instance.
  `List<IContentElement>`
  `getContentElements()`
  Returns all content elements.
  `ChapterDisplayType`
  `getDisplayType()`
  Gets the information that a chapter field should display.
  `int`
  `getOutlineLevel()`
  Gets the outline level.
  `IContentElement`
  `getParent()`
  Returns the parent content element.
  `String`
  `getValue()`
  Gets the chapter.
  `void`
  `setDisplayType​(ChapterDisplayType displayType)`
  Sets the information that a chapter field should display.
  `void`
  `setOutlineLevel​(int outlineLevel)`
  Sets the outline level.
  `void`
  `setParent​(IContentElement parent)`
  Sets the parent content element.
  `void`
  `setValue​(String value)`
  Sets the chapter.
  `String`
  `toString()`
  Converts the value of the current Chapter object to its equivalent string representation.

  ### Methods inherited from class java.lang.Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### Chapter

    public Chapter()
    Initializes a new instance of the Chapter class.

  - ### Chapter

    public Chapter​(InternalXMLStreamReader reader) throws XMLStreamException
    Instantiates a new chapter.
    Parameters:
      `reader` - the reader
    Throws:
      `XMLStreamException` - the xML stream exception

- ## Method Details

  - ### getContentElements

    public List<IContentElement> getContentElements()
    Returns all content elements.
    Specified by:
      `getContentElements` in interface `IContentElement`
    Specified by:
      `getContentElements` in class `Field`
    Returns:
      A collection of content elements.

  - ### getParent

    public IContentElement getParent()
    Returns the parent content element.
    Specified by:
      `getParent` in interface `IContentElement`
    Overrides:
      `getParent` in class `Field`
    Returns:
      the parent

  - ### setParent

    public void setParent​(IContentElement parent)
    Sets the parent content element.
    Specified by:
      `setParent` in interface `IContentElement`
    Overrides:
      `setParent` in class `Field`
    Parameters:
      `parent` - the new parent

  - ### clone

    public Chapter clone()
    Creates a new object that is a deep copy of the current instance.
    Specified by:
      `clone` in interface `IContentElement`
    Specified by:
      `clone` in interface `IParagraphContent`
    Specified by:
      `clone` in class `Field`
    Returns:
      A new object that is a copy of this instance.

  - ### toString

    public String toString()
    Converts the value of the current Chapter object to its equivalent string representation.
    Overrides:
      `toString` in class `Object`
    Returns:
      the string

  - ### getDisplayType

    public ChapterDisplayType getDisplayType()
    Gets the information that a chapter field should display.
    Returns:
      the display type

  - ### setDisplayType

    public void setDisplayType​(ChapterDisplayType displayType)
    Sets the information that a chapter field should display.
    Parameters:
      `displayType` - the new display type

  - ### getOutlineLevel

    public int getOutlineLevel()
    Gets the outline level.
    Returns:
      the outline level

  - ### setOutlineLevel

    public void setOutlineLevel​(int outlineLevel)
    Sets the outline level.
    Parameters:
      `outlineLevel` - the new outline level

  - ### getValue

    public String getValue()
    Gets the chapter.
    Returns:
      the value

  - ### setValue

    public void setValue​(String value)
    Sets the chapter.
    Parameters:
      `value` - the new value