Package com.tibco.patterns.learn.api.project

## Class ProjectSettings

- java.lang.Object
- - com.tibco.patterns.learn.api.project.ProjectSettings

-     public final class ProjectSettings
      extends java.lang.Object

  Stores all settings for a single Patterns Learn project.xml file.

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `int` | `getActiveModelIndex()` |
    `java.util.Date` | `getDataFileLastModified​(int fileIndex)` | Get the data file last modified date, as that date is remembered in the project.
    `java.util.List<java.lang.String>` | `getFieldNames()` |
    `FieldStats` | `getFieldStats​(int fileIndex, int fieldIndex)` |
    `java.lang.Integer` | `getKeyFieldIndex()` |
    `java.lang.String` | `getName()` |
    `int` | `getNDataFiles()` |
    `int` | `getNFields()` |
    `java.util.List<java.lang.String>` | `getNonKeyFieldNames()` |
    `java.lang.String` | `getNote()` |
    `int` | `getVersion()` |
    `void` | `setFieldStats​(int fileIndex, int fieldIndex, FieldStats stats)` | Assigns the given field statistics to a field with the given fieldIndex.
    `void` | `setNote​(java.lang.String value)` |
    `java.lang.String` | `toString()` |

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

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

- - ### Method Detail

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### getVersion

          public int getVersion()

      Returns:
        XML version of the file. This setting is not configurable, so no setter. New files will always be saved using the latest XML format.

    - #### getName

          public java.lang.String getName()

      Returns:
        the name of the project (same as project directory)

    - #### setNote

          public void setNote​(java.lang.String value)

      Parameters:
        `value` - - note for this project.

    - #### getNote

          public java.lang.String getNote()

      Returns:
        note for this project.

    - #### setFieldStats

          public void setFieldStats​(int fileIndex,
                                    int fieldIndex,
                                    FieldStats stats)

      Assigns the given field statistics to a field with the given fieldIndex. The data file and field names have to be set previously.

    - #### getNDataFiles

          public int getNDataFiles()

      Returns:
        the number of data files assigned to the project.

    - #### getDataFileLastModified

          public java.util.Date getDataFileLastModified​(int fileIndex)

      Get the data file last modified date, as that date is remembered in the project.
      Parameters:
        `fileIndex` - - index of the data file
      Returns:
        the stored date that the data file was modified.

    - #### getNFields

          public int getNFields()

      Returns:
        the number of all fields defined for this project, including the key field.

    - #### getFieldNames

          public java.util.List<java.lang.String> getFieldNames()

      Returns:
        names of all fields defined for this project. When there is only 1 data file, this list matches the list of file field names.

    - #### getKeyFieldIndex

          public java.lang.Integer getKeyFieldIndex()

      Returns:
        the index of key field in the list of field names of the data file; null if the key field is not assigned.

    - #### getNonKeyFieldNames

          public java.util.List<java.lang.String> getNonKeyFieldNames()

      Returns:
        names of all non-key fields defined for this project.
      Throws:
        `java.lang.IllegalStateException` - if key field is not assigned.

    - #### getFieldStats

          public FieldStats getFieldStats​(int fileIndex,
                                          int fieldIndex)

      Returns:
        field statistics for the field with the given fieldIndex.

    - #### getActiveModelIndex

          public int getActiveModelIndex()

      Returns:
        the index of the active model in the list of models; -1 if the list of models is empty.