Package: groovy.org.codenarc.results

## [Groovy] Class DirectoryResults

- groovy.org.codenarc.results.DirectoryResults

- All Implemented Interfaces and Traits:
    Results

      class DirectoryResults

  Represents the results for a directory

  Authors:
    Chris Mair

- - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `int` | `numberOfFilesInThisDirectory`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `DirectoryResults ()` Create a new uninitialized instance
    `DirectoryResults (String path)` Create a new instance with the specified path
    `DirectoryResults (String path, int numberOfFilesInThisDirectory)` Create a new instance with the specified path and number of files in the directory

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `void` | `addChild(Results child)`
    `` | `Results` | `findResultsForPath(String path)` Return the Results object with the specified path within this directory or its descendents.
    `` | `List` | `getChildren()` @return the List of child Results objects; may be empty
    `` | `int` | `getNumberOfFilesWithViolations(int maxPriority, boolean recursive = true)` Return the number of files with violations
    `` | `int` | `getNumberOfViolationsWithPriority(int priority, boolean recursive = true)` Return the number of violations with the specified priority
    `` | `String` | `getPath()` @return the path to the file or directory associated with these results
    `` | `int` | `getTotalNumberOfFiles(boolean recursive = true)` Return the total number of (Groovy) files analyzed
    `` | `List` | `getViolations()` @return the List of all violations; may be empty
    `` | `boolean` | `isFile()` @return false (this object does not represents the results for a single file)
    `` | `String` | `toString()`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, toString, hashCode, getClass, notify, notifyAll, wait, wait, wait`

- - ### Property Detail

    - #### int numberOfFilesInThisDirectory

  - ### Constructor Detail

    - #### DirectoryResults()

      Create a new uninitialized instance

    - #### DirectoryResults(String path)

      Create a new instance with the specified path

      Parameters:
        `path` - - the path

    - #### DirectoryResults(String path, int numberOfFilesInThisDirectory)

      Create a new instance with the specified path and number of files in the directory

  - ### Method Detail

    - #### void addChild(Results child)

    - #### Results findResultsForPath(String path)

      Return the Results object with the specified path within this directory or its descendents.

      Parameters:
        `path` - - the path to search for
      Returns:
        this Results object if a match is found, otherwise null

    - #### List getChildren()

      Returns:
        the List of child Results objects; may be empty

    - #### int getNumberOfFilesWithViolations(int maxPriority, boolean recursive = true)

      Return the number of files with violations

      Parameters:
        `maxPriority` - - the maximum priority level; ignore violations with priority greater than this
        `recursive` - - true if the returned count should include subdirectories as well; defaults to true
      Returns:
        the number of files containing violations

    - #### int getNumberOfViolationsWithPriority(int priority, boolean recursive = true)

      Return the number of violations with the specified priority

      Parameters:
        `recursive` - - true if the returned count should include subdirectories as well; defaults to true
      Returns:
        the number of violations with the specified priority

    - #### String getPath()

      Returns:
        the path to the file or directory associated with these results

    - #### int getTotalNumberOfFiles(boolean recursive = true)

      Return the total number of (Groovy) files analyzed

      Parameters:
        `recursive` - - true if the returned count should include subdirectories as well
      Returns:
        the total number of files (with or without violations)

    - #### List getViolations()

      Returns:
        the List of all violations; may be empty

    - #### boolean isFile()

      Returns:
        false (this object does not represents the results for a single file)

    - #### String toString()