Package com.io7m.smfj.format.support

## Class SMFTriangleTracker

- java.lang.Object
- - com.io7m.smfj.format.support.SMFTriangleTracker

-     public final class SMFTriangleTracker
      extends java.lang.Object

  A tracker of triangle counts and indices.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static interface` | `SMFTriangleTracker.ErrorReceiverType` | A receiver of error messages.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `SMFTriangleTracker​(SMFTriangleTracker.ErrorReceiverType inErrors, long inVertexCount, long inTriangleCount)` | Construct a tracker.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addTriangle​(com.io7m.jlexing.core.LexicalPosition<java.net.URI> lexical, long v0, long v1, long v2)` | Add a triangle.
    `boolean` | `check​(com.io7m.jlexing.core.LexicalPosition<java.net.URI> lexical)` | Check that all invariants hold.

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

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

- - ### Constructor Detail

    - #### SMFTriangleTracker

          public SMFTriangleTracker​(SMFTriangleTracker.ErrorReceiverType inErrors,
                                    long inVertexCount,
                                    long inTriangleCount)

      Construct a tracker.
      Parameters:
        `inErrors` - A receiver of errors
        `inVertexCount` - The expected number of vertices
        `inTriangleCount` - The expected number of triangles

  - ### Method Detail

    - #### addTriangle

          public void addTriangle​(com.io7m.jlexing.core.LexicalPosition<java.net.URI> lexical,
                                  long v0,
                                  long v1,
                                  long v2)

      Add a triangle.
      Parameters:
        `lexical` - The triangle declaration position
        `v0` - The index of vertex 0
        `v1` - The index of vertex 1
        `v2` - The index of vertex 2

    - #### check

          public boolean check​(com.io7m.jlexing.core.LexicalPosition<java.net.URI> lexical)

      Check that all invariants hold. If they do not, errors will be published to the error receiver and `false` returned.
      Parameters:
        `lexical` - The lexical position
      Returns:
        `true` if all invariants hold