org.tmatesoft.svn.core

## Class SVNDepth

- java.lang.Object
- - org.tmatesoft.svn.core.SVNDepth

- All Implemented Interfaces:
    java.lang.Comparable

      public class SVNDepth
      extends java.lang.Object
      implements java.lang.Comparable

  This class contains enumeration that describes depth, that is used. The order of these depths is important: the higher the number, the deeper it descends. You can use it to compare two depths numerically to decide which goes deeper.
  Since:
    1.2
  Version:
    1.3
  Author:
    TMate Software Ltd.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static SVNDepth` | `EMPTY` Just the named directory D, no entries.
    `static SVNDepth` | `EXCLUDE` Exclude (don't descend into) directory D.
    `static SVNDepth` | `FILES` D and its file children, but not subdirectories.
    `static SVNDepth` | `IMMEDIATES` D and its immediate children (D and its entries).
    `static SVNDepth` | `INFINITY` D and all descendants (full recursion from D).
    `static SVNDepth` | `UNKNOWN` Depth undetermined or ignored.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.String` | `asString(SVNDepth depth)` Appropriate name of `depth` is returned.
    `int` | `compareTo(java.lang.Object o)` Compares this object to another one.
    `boolean` | `equals(java.lang.Object obj)` Says whether this object and `obj` are equal.
    `static SVNDepth` | `fromID(int id)` Based on depth id returns `SVNDepth` value.
    `static SVNDepth` | `fromRecurse(boolean recurse)` Treats recursion as `INFINITY` depth and `FILES` otherwise
    `static SVNDepth` | `fromString(java.lang.String string)` Based on string value finds `SVNDepth` value.
    `int` | `getId()` Gets numerical Id of depth
    `static SVNDepth` | `getInfinityOrEmptyDepth(boolean recurse)` Returns `INFINITY` if `recurse` is `true`, else returns `EMPTY`.
    `static SVNDepth` | `getInfinityOrFilesDepth(boolean recurse)` The same as `getInfinityOrEmptyDepth(boolean)`, but `FILES` is returned when recursive.
    `static SVNDepth` | `getInfinityOrImmediatesDepth(boolean recurse)` The same as `getInfinityOrEmptyDepth(boolean)`, but `IMMEDIATES` is returned when recursive.
    `java.lang.String` | `getName()` Gets the name of depth
    `static SVNDepth` | `getUnknownOrEmptyDepth(boolean recurse)` Returns `UNKNOWN` if `recurse` is `true`, else returns `EMPTY`.
    `static SVNDepth` | `getUnknownOrFilesDepth(boolean recurse)` The same as `getUnknownOrEmptyDepth(boolean)`, but `FILES` is returned when recursive.
    `static SVNDepth` | `getUnknownOrImmediatesDepth(boolean recurse)` The same as `getUnknownOrEmptyDepth(boolean)`, but `IMMEDIATES` is returned when recursive.
    `boolean` | `isRecursive()` Returns a recursion boolean based on depth.
    `static boolean` | `recurseFromDepth(SVNDepth depth)` Based on depth determines if it is recursive or not.
    `java.lang.String` | `toString()` Returns a string representation of this object.

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

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

- - ### Field Detail

    - #### UNKNOWN

          public static final SVNDepth UNKNOWN

      Depth undetermined or ignored.

    - #### EXCLUDE

          public static final SVNDepth EXCLUDE

      Exclude (don't descend into) directory D.

    - #### EMPTY

          public static final SVNDepth EMPTY

      Just the named directory D, no entries. For instance, update will not pull in any files or subdirectories.

    - #### FILES

          public static final SVNDepth FILES

      D and its file children, but not subdirectories. For instance, updates will pull in any files, but not subdirectories.

    - #### IMMEDIATES

          public static final SVNDepth IMMEDIATES

      D and its immediate children (D and its entries). Updates will pull in any files or subdirectories without any children.

    - #### INFINITY

          public static final SVNDepth INFINITY

      D and all descendants (full recursion from D). For instance, updates will pull in any files or subdirectories recursively.

  - ### Method Detail

    - #### getId

          public int getId()

      Gets numerical Id of depth
      Returns:
        depth Id
      Since:
        SVNKit 1.2.0, SVN 1.5.0

    - #### getName

          public java.lang.String getName()

      Gets the name of depth
      Returns:
        depth name
      Since:
        SVNKit 1.2.0, SVN 1.5.0

    - #### toString

          public java.lang.String toString()

      Returns a string representation of this object.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        string representation of this object

    - #### isRecursive

          public boolean isRecursive()

      Returns a recursion boolean based on depth. Although much code has been converted to use depth, some code still takes a recurse boolean. In most cases, it makes sense to treat unknown or infinite depth as recursive, and any other depth as non-recursive (which in turn usually translates to `FILES`).
      Returns:
        if recursion is used
      Since:
        SVNKit 1.2.0, SVN 1.5.0

    - #### compareTo

          public int compareTo(java.lang.Object o)

      Compares this object to another one.
      Specified by:
        `compareTo` in interface `java.lang.Comparable`
      Parameters:
        `o` - object to compare with
      Returns:
        `-1` if `o` is null, or not an `SVNDepth` instance, or its `id` is greater than this object's id; `0` if ids this object and `o` are equal; `1` if id of this object is greater than the one of `o`.

    - #### equals

          public boolean equals(java.lang.Object obj)

      Says whether this object and `obj` are equal.
      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `obj` - another object to compare with
      Returns:
        true if equal; otherwise false

    - #### asString

          public static java.lang.String asString(SVNDepth depth)

      Appropriate name of `depth` is returned. If `depth` does not represent a recognized depth, `"INVALID-DEPTH"` is returned.
      Parameters:
        `depth` - depth, which name needs to be returned
      Returns:
        the name of depth
      Since:
        SVNKit 1.2.0, SVN 1.5.0

    - #### recurseFromDepth

          public static boolean recurseFromDepth(SVNDepth depth)

      Based on depth determines if it is recursive or not. In most cases, it makes sense to treat unknown or infinite depth as recursive, and any other depth as non-recursive
      Parameters:
        `depth` - depth value
      Returns:
        if it is recursive
      Since:
        SVNKit 1.2.0, SVN 1.5.0
      See Also:
        `isRecursive()`, `fromRecurse(boolean)`

    - #### fromRecurse

          public static SVNDepth fromRecurse(boolean recurse)

      Treats recursion as `INFINITY` depth and `FILES` otherwise
      Parameters:
        `recurse` - indicator of recursion
      Returns:
        depth
      Since:
        SVNKit 1.2.0, SVN 1.5.0
      See Also:
        `isRecursive()`, `recurseFromDepth(SVNDepth)`

    - #### fromString

          public static SVNDepth fromString(java.lang.String string)

      Based on string value finds `SVNDepth` value.
      Parameters:
        `string` - depth value represented by string
      Returns:
        depth
      Since:
        SVNKit 1.2.0, SVN 1.5.0

    - #### fromID

          public static SVNDepth fromID(int id)

      Based on depth id returns `SVNDepth` value.
      Parameters:
        `id` - depth id
      Returns:
        depth
      Since:
        SVNKit 1.2.0, SVN 1.5.0

    - #### getInfinityOrEmptyDepth

          public static SVNDepth getInfinityOrEmptyDepth(boolean recurse)

      Returns `INFINITY` if `recurse` is `true`, else returns `EMPTY`. Code should never need to use this, it is called only from pre-depth APIs, for compatibility.
      Parameters:
        `recurse` - boolean
      Returns:
        depth
      Since:
        SVNKit 1.2.0, SVN 1.5.0

    - #### getInfinityOrFilesDepth

          public static SVNDepth getInfinityOrFilesDepth(boolean recurse)

      The same as `getInfinityOrEmptyDepth(boolean)`, but `FILES` is returned when recursive. Code should never need to use this, it is called only from pre-depth APIs, for compatibility.
      Parameters:
        `recurse` - boolean
      Returns:
        depth
      Since:
        SVNKit 1.2.0, SVN 1.5.0

    - #### getInfinityOrImmediatesDepth

          public static SVNDepth getInfinityOrImmediatesDepth(boolean recurse)

      The same as `getInfinityOrEmptyDepth(boolean)`, but `IMMEDIATES` is returned when recursive. Code should never need to use this, it is called only from pre-depth APIs, for compatibility.
      Parameters:
        `recurse` - boolean
      Returns:
        depth
      Since:
        SVNKit 1.2.0, SVN 1.5.0

    - #### getUnknownOrEmptyDepth

          public static SVNDepth getUnknownOrEmptyDepth(boolean recurse)

      Returns `UNKNOWN` if `recurse` is `true`, else returns `EMPTY`. Code should never need to use this, it is called only from pre-depth APIs, for compatibility.
      Parameters:
        `recurse` - boolean
      Returns:
        depth
      Since:
        SVNKit 1.2.0, SVN 1.5.0

    - #### getUnknownOrFilesDepth

          public static SVNDepth getUnknownOrFilesDepth(boolean recurse)

      The same as `getUnknownOrEmptyDepth(boolean)`, but `FILES` is returned when recursive. Code should never need to use this, it is called only from pre-depth APIs, for compatibility.
      Parameters:
        `recurse` - boolean
      Returns:
        depth
      Since:
        SVNKit 1.2.0, SVN 1.5.0

    - #### getUnknownOrImmediatesDepth

          public static SVNDepth getUnknownOrImmediatesDepth(boolean recurse)

      The same as `getUnknownOrEmptyDepth(boolean)`, but `IMMEDIATES` is returned when recursive. Code should never need to use this, it is called only from pre-depth APIs, for compatibility.
      Parameters:
        `recurse` - boolean
      Returns:
        depth
      Since:
        SVNKit 1.2.0, SVN 1.5.0