com.io7m.jstructural.annotated

## Class SADocumentWithSections

- java.lang.Object
- - com.io7m.jstructural.annotated.SADocument
  - - com.io7m.jstructural.annotated.SADocumentWithSections

- All Implemented Interfaces:
    SASegmentsReadable

      public final class SADocumentWithSections
      extends SADocument

  A document with sections.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SADocumentWithSections(SAIDMap in_ids, SADocumentTitle in_title, com.io7m.jaux.functional.Option<SDocumentContents> in_contents, com.io7m.jaux.functional.Option<SDocumentStyle> in_style, SNonEmptyList<SASection> in_content, List<SAFootnote> in_footnotes, SAFormalItemsByKind in_formals)` Construct a new document with sections.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `<A> A` | `documentAccept(SADocumentVisitor<A> v)` Accept a document visitor.
    `boolean` | `equals(Object obj)`
    `com.io7m.jaux.functional.Option<SASection>` | `getSection(SASectionNumber n)`
    `SNonEmptyList<SASection>` | `getSections()`
    `int` | `hashCode()`
    `SASegmentNumber` | `segmentGetFirst()`
    `com.io7m.jaux.functional.Option<SASegmentNumber>` | `segmentGetNext(SASegmentNumber n)`
    `com.io7m.jaux.functional.Option<SASegmentNumber>` | `segmentGetPrevious(SASegmentNumber n)`
    `com.io7m.jaux.functional.Option<SASegmentNumber>` | `segmentGetUp(SASegmentNumber n)`

    - ### Methods inherited from class com.io7m.jstructural.annotated.SADocument

      `getContents, getFootnotes, getFormals, getIDMappings, getStyle, getTitle`

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

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SADocumentWithSections

          public SADocumentWithSections(@Nonnull
                                SAIDMap in_ids,
                                @Nonnull
                                SADocumentTitle in_title,
                                @Nonnull
                                com.io7m.jaux.functional.Option<SDocumentContents> in_contents,
                                @Nonnull
                                com.io7m.jaux.functional.Option<SDocumentStyle> in_style,
                                @Nonnull
                                SNonEmptyList<SASection> in_content,
                                @Nonnull
                                List<SAFootnote> in_footnotes,
                                @Nonnull
                                SAFormalItemsByKind in_formals)
                                 throws com.io7m.jaux.Constraints.ConstraintError

      Construct a new document with sections.
      Parameters:
        `in_ids` - The set of mappings from IDs to elements
        `in_title` - The title
        `in_contents` - Whether or not the document has a table of contents
        `in_style` - The style
        `in_content` - The list of sections
        `in_footnotes` - The list of footnotes
        `in_formals` - The formal items
      Throws:
        `com.io7m.jaux.Constraints.ConstraintError` - If any parameter is `null`

  - ### Method Detail

    - #### documentAccept

          public <A> A documentAccept(@Nonnull
                             SADocumentVisitor<A> v)
                           throws com.io7m.jaux.Constraints.ConstraintError,
                                  Exception

      Description copied from class: `SADocument`
      Accept a document visitor.
      Specified by:
        `documentAccept` in class `SADocument`
      Type Parameters:
        `A` - The type of values returned by the visitor
      Parameters:
        `v` - The visitor
      Returns:
        The value returned by the visitor
      Throws:
        `com.io7m.jaux.Constraints.ConstraintError` - If the visitor raises `Constraints.ConstraintError`
        `Exception` - If the visitor raises an `Exception`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `SADocument`

    - #### getSection

          public com.io7m.jaux.functional.Option<SASection> getSection(@Nonnull
                                                              SASectionNumber n)
                                                                throws com.io7m.jaux.Constraints.ConstraintError

      Specified by:
        `getSection` in class `SADocument`
      Parameters:
        `n` - The section number
      Returns:
        The section with the given section number, if any.
      Throws:
        `com.io7m.jaux.Constraints.ConstraintError` - If any parameter is `null`

    - #### getSections

          @Nonnull
          public SNonEmptyList<SASection> getSections()

      Returns:
        The document sections

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `SADocument`

    - #### segmentGetFirst

          public SASegmentNumber segmentGetFirst()

      Returns:
        The number of the first segment

    - #### segmentGetNext

          public com.io7m.jaux.functional.Option<SASegmentNumber> segmentGetNext(@Nonnull
                                                                        SASegmentNumber n)
                                                                          throws com.io7m.jaux.Constraints.ConstraintError

      Parameters:
        `n` - The current segment
      Returns:
        The number of the next segment (if any)
      Throws:
        `com.io7m.jaux.Constraints.ConstraintError` - If any parameter is `null`

    - #### segmentGetPrevious

          public com.io7m.jaux.functional.Option<SASegmentNumber> segmentGetPrevious(@Nonnull
                                                                            SASegmentNumber n)
                                                                              throws com.io7m.jaux.Constraints.ConstraintError

      Parameters:
        `n` - The current segment
      Returns:
        The number of the previous segment (if any)
      Throws:
        `com.io7m.jaux.Constraints.ConstraintError` - If any parameter is `null`

    - #### segmentGetUp

          public com.io7m.jaux.functional.Option<SASegmentNumber> segmentGetUp(@Nonnull
                                                                      SASegmentNumber n)
                                                                        throws com.io7m.jaux.Constraints.ConstraintError

      Parameters:
        `n` - The current segment
      Returns:
        The number of the parent segment (if any)
      Throws:
        `com.io7m.jaux.Constraints.ConstraintError` - If any parameter is `null`

Copyright © 2014 <code@io7m.com> http://io7m.com