Class PathWrapperBase<T, F extends Path<T>>

java.lang.Object
org.aksw.commons.path.core.PathWrapperBase<T,F>
All Implemented Interfaces:
Comparable<Path<T>>, Iterable<Path<T>>, Path<T>
Direct Known Subclasses:
PathSysBase

public abstract class PathWrapperBase<T, F extends Path<T>> extends Object implements Path<T>
Base implementation for custom path wrappers with the main focus on custom values for the 'system' property. This class implements all methods of Path and forwards all calls to the delegate. The result of the operation on the delegate is then passed to the abstract wrap(Path) function which can then produce an appropriate implementation of the wrapper.
  • Field Details

    • delegate

      protected Path<T> delegate
  • Constructor Details

    • PathWrapperBase

      public PathWrapperBase(Path<T> delegate)
  • Method Details

    • wrapOrNull

      protected F wrapOrNull(Path<T> basePath)
    • wrap

      protected abstract F wrap(Path<T> basePath)
    • unwrap

      protected Path<T> unwrap(Path<T> wrappedPath)
    • getDelegate

      public Path<T> getDelegate()
    • iterator

      public Iterator<Path<T>> iterator()
      Specified by:
      iterator in interface Iterable<T>
    • compareTo

      public int compareTo(Path<T> o)
      Specified by:
      compareTo in interface Comparable<T>
    • toAbsolutePath

      public F toAbsolutePath()
      Specified by:
      toAbsolutePath in interface Path<T>
    • isAbsolute

      public boolean isAbsolute()
      Specified by:
      isAbsolute in interface Path<T>
    • getSegments

      public List<T> getSegments()
      Specified by:
      getSegments in interface Path<T>
    • getRoot

      public F getRoot()
      Specified by:
      getRoot in interface Path<T>
    • getFileName

      public F getFileName()
      Specified by:
      getFileName in interface Path<T>
    • getParent

      public F getParent()
      Specified by:
      getParent in interface Path<T>
    • getNameCount

      public int getNameCount()
      Specified by:
      getNameCount in interface Path<T>
    • getName

      public F getName(int index)
      Specified by:
      getName in interface Path<T>
    • subpath

      public F subpath(int beginIndex, int endIndex)
      Specified by:
      subpath in interface Path<T>
    • subpath

      public F subpath(int beginIndex)
      Description copied from interface: Path
      Experimental. Not part of nio Path.
      Specified by:
      subpath in interface Path<T>
    • startsWith

      public boolean startsWith(Path<T> other)
      Specified by:
      startsWith in interface Path<T>
    • endsWith

      public boolean endsWith(Path<T> other)
      Specified by:
      endsWith in interface Path<T>
    • normalize

      public F normalize()
      Specified by:
      normalize in interface Path<T>
    • resolveStr

      public F resolveStr(String other)
      Specified by:
      resolveStr in interface Path<T>
    • resolve

      public F resolve(T other)
      Specified by:
      resolve in interface Path<T>
    • resolve

      public F resolve(Path<T> other)
      Specified by:
      resolve in interface Path<T>
    • resolveSiblingStr

      public F resolveSiblingStr(String other)
      Specified by:
      resolveSiblingStr in interface Path<T>
    • resolveSibling

      public F resolveSibling(T other)
      Specified by:
      resolveSibling in interface Path<T>
    • resolveSibling

      public F resolveSibling(Path<T> other)
      Specified by:
      resolveSibling in interface Path<T>
    • relativize

      public F relativize(Path<T> other)
      Specified by:
      relativize in interface Path<T>
    • getSystem

      public Object getSystem()
      Description copied from interface: Path
      Returns an object such as the file system underlying this path. Returns null if not applicable. Experimental.
      Specified by:
      getSystem in interface Path<T>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object