org.infinispan.schematic.internal.document

## Class Paths.SinglePath

- java.lang.Object
- - org.infinispan.schematic.internal.document.Paths.SinglePath

- All Implemented Interfaces:
    Comparable<Path>, Iterable<String>, Path
  Enclosing class:
    Paths

      @Immutable
      @SerializeWith(value=Paths.Externalizer.class)
      protected static final class Paths.SinglePath
      extends Object
      implements Path

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `Paths.SinglePath(String fieldName)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(Path that)`
    `boolean` | `equals(Object obj)`
    `String` | `get(int index)` Get a particular segment within this path.
    `String` | `getFirst()` Get the first segment in the path.
    `String` | `getLast()` Get the last segment in the path.
    `int` | `hashCode()`
    `Iterator<String>` | `iterator()`
    `Path` | `parent()` Get the parent path, which may be an empty path.
    `int` | `size()` Get the number of segments in this path.
    `boolean` | `startsWith(Path ancestor)` Determine if the first segments of this path are equal to the segments in the supplied path.
    `String` | `toString()`
    `Path` | `with(String fieldName)` Obtain a path that has this path as the parent and which has as the last segment the supplied field name.

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

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

- - ### Constructor Detail

    - #### Paths.SinglePath

          protected Paths.SinglePath(String fieldName)

  - ### Method Detail

    - #### iterator

          public Iterator<String> iterator()

      Specified by:
        `iterator` in interface `Iterable<String>`

    - #### get

          public String get(int index)

      Description copied from interface: `Path`
      Get a particular segment within this path.
      Specified by:
        `get` in interface `Path`
      Parameters:
        `index` - the 0-based index of the segment in this path
      Returns:
        the segment; never null

    - #### getLast

          public String getLast()

      Description copied from interface: `Path`
      Get the last segment in the path.
      Specified by:
        `getLast` in interface `Path`
      Returns:
        the field name in the last segment of this path, or null if this is the empty path

    - #### getFirst

          public String getFirst()

      Description copied from interface: `Path`
      Get the first segment in the path.
      Specified by:
        `getFirst` in interface `Path`
      Returns:
        the field name in the first segment of this path, or null if this is the empty path

    - #### with

          public Path with(String fieldName)

      Description copied from interface: `Path`
      Obtain a path that has this path as the parent and which has as the last segment the supplied field name.
      Specified by:
        `with` in interface `Path`
      Parameters:
        `fieldName` - the field name for the last segment in the new path; may be null
      Returns:
        the new path, or this path if the `fieldName` parameter is null; never null

    - #### parent

          public Path parent()

      Description copied from interface: `Path`
      Get the parent path, which may be an empty path.
      Specified by:
        `parent` in interface `Path`
      Returns:
        the parent path; never null

    - #### size

          public int size()

      Description copied from interface: `Path`
      Get the number of segments in this path. An empty path with have a size of '0'.
      Specified by:
        `size` in interface `Path`
      Returns:
        the size of this path; never negative

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### compareTo

          public int compareTo(Path that)

      Specified by:
        `compareTo` in interface `Comparable<Path>`

    - #### startsWith

          public boolean startsWith(Path ancestor)

      Description copied from interface: `Path`
      Determine if the first segments of this path are equal to the segments in the supplied path. This method returns true if the two paths are equal, or if the supplied path is an ancestor of this path.
      Specified by:
        `startsWith` in interface `Path`
      Parameters:
        `ancestor` - the other path; may not be null
      Returns:
        true if the other path is equal to or an ancestor of this path, or false otherwise

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.