com.io7m.jpra.model.type_declarations

## Class TypeDeclRecord<I,T>

- java.lang.Object
- - com.io7m.jpra.model.type_declarations.TypeDeclRecord<I,T>

- Type Parameters:
    `I` - The type of identifiers
    `T` - The type of type information
  All Implemented Interfaces:
    ModelElementType, StatementType<I,T>, TypeDeclType<I,T>

      @Immutable
      public final class TypeDeclRecord<I,T>
      extends Object
      implements TypeDeclType<I,T>

  A `record` type declaration.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TypeDeclRecord(I in_identifier, T in_type, com.gs.collections.api.map.ImmutableMap<FieldName,RecordFieldDeclValue<I,T>> in_fields_name, TypeName in_name, com.gs.collections.api.list.ImmutableList<RecordFieldDeclType<I,T>> in_fields_order)` Construct a declaration.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `com.gs.collections.api.map.ImmutableMap<FieldName,RecordFieldDeclValue<I,T>>` | `getFieldsByName()`
    `com.gs.collections.api.list.ImmutableList<RecordFieldDeclType<I,T>>` | `getFieldsInDeclarationOrder()`
    `I` | `getIdentifier()`
    `Optional<com.io7m.jlexing.core.ImmutableLexicalPositionType<Path>>` | `getLexicalInformation()` Fetch the lexical information for the element.
    `TypeName` | `getName()`
    `T` | `getType()`
    `<A,E extends Exception> A` | `matchStatement(StatementMatcherType<I,T,A,E> m)` Accept a matcher.
    `<A,E extends Exception> A` | `matchTypeDeclaration(TypeDeclMatcherType<I,T,A,E> m)` Accept a type declaration matcher.

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

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

- - ### Constructor Detail

    - #### TypeDeclRecord

          public TypeDeclRecord(I in_identifier,
                                T in_type,
                                com.gs.collections.api.map.ImmutableMap<FieldName,RecordFieldDeclValue<I,T>> in_fields_name,
                                TypeName in_name,
                                com.gs.collections.api.list.ImmutableList<RecordFieldDeclType<I,T>> in_fields_order)

      Construct a declaration.
      Parameters:
        `in_identifier` - The identifier
        `in_type` - The type information
        `in_fields_name` - The fields by name
        `in_name` - The type name
        `in_fields_order` - The fields in declaration order

  - ### Method Detail

    - #### getFieldsByName

          public com.gs.collections.api.map.ImmutableMap<FieldName,RecordFieldDeclValue<I,T>> getFieldsByName()

      Returns:
        The fields by name

    - #### getFieldsInDeclarationOrder

          public com.gs.collections.api.list.ImmutableList<RecordFieldDeclType<I,T>> getFieldsInDeclarationOrder()

      Returns:
        The fields in declaration order

    - #### getName

          public TypeName getName()

      Specified by:
        `getName` in interface `TypeDeclType<I,T>`
      Returns:
        The type name

    - #### matchTypeDeclaration

          public <A,E extends Exception> A matchTypeDeclaration(TypeDeclMatcherType<I,T,A,E> m)
                                                         throws E extends Exception

      Description copied from interface: `TypeDeclType`
      Accept a type declaration matcher.
      Specified by:
        `matchTypeDeclaration` in interface `TypeDeclType<I,T>`
      Type Parameters:
        `A` - The type of returned values
        `E` - The type of raised exceptions
      Parameters:
        `m` - The matcher
      Returns:
        The value returned by `m`
      Throws:
        `E` - If `m` raises `E`
        `E extends Exception`

    - #### getLexicalInformation

          public Optional<com.io7m.jlexing.core.ImmutableLexicalPositionType<Path>> getLexicalInformation()

      Description copied from interface: `ModelElementType`
      Fetch the lexical information for the element. This is used to localize error messages to a position in a file when referring to specific elements.
      Specified by:
        `getLexicalInformation` in interface `ModelElementType`
      Returns:
        The original lexical information, if any

    - #### getType

          public T getType()

      Specified by:
        `getType` in interface `TypeDeclType<I,T>`
      Returns:
        The type

    - #### getIdentifier

          public I getIdentifier()

      Specified by:
        `getIdentifier` in interface `TypeDeclType<I,T>`
      Returns:
        The identifier

    - #### matchStatement

          public <A,E extends Exception> A matchStatement(StatementMatcherType<I,T,A,E> m)
                                                   throws E extends Exception

      Description copied from interface: `StatementType`
      Accept a matcher.
      Specified by:
        `matchStatement` in interface `StatementType<I,T>`
      Type Parameters:
        `A` - The type of returned values
        `E` - The type of raised exceptions
      Parameters:
        `m` - The matcher
      Returns:
        The value returned by `m`
      Throws:
        `E` - If `m` raises `E`
        `E extends Exception`

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