java.lang.Object
org.jdrupes.mdoclet.internal.doclets.toolkit.util.DocPath

public class DocPath extends Object
Abstraction for immutable relative paths.

Paths always use ‘/’ as a separator, and never begin or end with ‘/’.

  • Felddetails

  • Konstruktordetails

  • Methodendetails

    • create

      public static DocPath create(String p)
      Creates a path from a string.
      Parameter:
      p - the string
      Gibt zurück:
      the path
    • equals

      public boolean equals(Object other)
      Setzt außer Kraft:
      equals in Klasse Object
    • hashCode

      public int hashCode()
      Setzt außer Kraft:
      hashCode in Klasse Object
    • basename

      public DocPath basename()
    • parent

      public DocPath parent()
    • resolve

      public DocPath resolve(String p)
      Returns the path formed by appending the specified string to the current path.
      Parameter:
      p - the string
      Gibt zurück:
      the path
    • resolve

      public DocPath resolve(DocPath p)
      Returns the path by appending the specified path to the current path.
      Parameter:
      p - the path
      Gibt zurück:
      the path
    • invert

      public DocPath invert()
      Return the inverse path for this path.

      For example, if the path is a/b/c, the inverse path is ../../..

      Gibt zurück:
      the path
    • normalize

      public DocPath normalize()
      Returns the path formed by eliminating empty components, ‘.’ components, and redundant name/.. components.
      Gibt zurück:
      the path
    • relativize

      public DocPath relativize(DocPath other)
      Normalize and relativize a path against this path, assuming that this path is for a file (not a directory), in which the other path will appear.
      Parameter:
      other - the path to be relativized.
      Gibt zurück:
      the simplified path
    • isEmpty

      public boolean isEmpty()
      Return true if this path is empty.
      Gibt zurück:
      true if this path is empty
    • fragment

      public DocLink fragment(String fragment)
      Creates a DocLink formed from this path and a fragment identifier.
      Parameter:
      fragment - the fragment
      Gibt zurück:
      the link
    • getPath

      public String getPath()
      Returns this path as a string.
      Gibt zurück:
      the path