Returns the parent of this path or null if this path is the root path.

@return the parent of this path or null if this path is the root path.
175937
public Path getParent() {
		if (!isAbsolute())
			throw new IllegalStateException("path is not absolute: " + toString());
		if (segments.isEmpty())
			return null;
		return new Path(segments.subList(0, segments.size()-1), true);
	}
424828
public SmiOidNode getRootNode() {
        SmiOidNode parent = this;
        while (parent.getParent() != null) {
            parent = parent.getParent();
        }
        return parent;
    }
1180828
public function getRootPath()
    {
        if (null === $this->rootPath) {
            if (method_exists($this, 'setRootPath')) {
                $this->rootPath = realpath($this->setRootPath());
            } else {
                $this->rootPath = realpath(__DIR__.'/../../../../..');
            }
        }
        //$this->rootPath = '../';

        return $this->rootPath;
    }
754553
public function getParent()
    {
        $parentID = $this->getField("ParentID");
        if ($parentID) {
            return SiteTree::get_by_id(self::class, $parentID);
        }
        return null;
    }
1031046
public BaseCondition getRoot() {
      BaseCondition p = this;
      while (p.getParent() != null) {
         p = p.getParent();
      }
      return p;
   }
674818
public View<?, ?> getRootParentView()
	{
		View<?, ?> currentView = this;
		while (currentView.hasParent())
		{
			currentView = currentView.getParent();
		}
		return currentView;
	}
653554
public function getParent()
    {
        if ($this->isRoot()) {
            return null;
        }

        $parentPath = $this->getParentPath();
        $node = $this->context->getFirstLevelNodeCache()->getByPath($parentPath);
        if ($node !== false) {
            return $node;
        }
        $node = $this->nodeDataRepository->findOneByPathInContext($parentPath, $this->context);
        $this->context->getFirstLevelNodeCache()->setByPath($parentPath, $node);

        return $node;
    }
1011007
@Nullable
  protected String getParentPath(String path) {
    // Root does not have a parent.
    if (isRoot(path)) {
      return null;
    }
    int separatorIndex = path.lastIndexOf(PATH_SEPARATOR);
    if (separatorIndex < 0) {
      return null;
    }
    return path.substring(0, separatorIndex);
  }
1304832
protected String getRelativePath(String ancestor, String rootPath) {

        String result = rootPath.substring(ancestor.length());
        result = CmsStringUtil.joinPaths("/", result, "/");
        return result;
    }
652667
public Type getParentType()
    {
        Type ret = null;
        if (this.parentTypeId != null && this.parentTypeId != 0) {
            try {
                ret = Type.get(this.parentTypeId);
            } catch (final CacheReloadException e) {
                Type.LOG.error("Could not read parentType for id: {}", this.parentTypeId);
            }
        }
        return ret;
    }
196435
public String getParentXPath() {
        Iterator<Level> levelIterator = path.descendingIterator();
        if (levelIterator.hasNext()) {
            levelIterator.next();
        }
        return getXPath(levelIterator);
    }
127651
public function topParent()
    {
        $topParent = $this->parent();

        if (!$topParent) {
            return null;
        }

        while (true) {
            $theParent = $topParent->parent();
            if ($theParent !== null && $theParent->parent() !== null) {
                $topParent = $theParent;
            } else {
                break;
            }
        }

        return $topParent;
    }
1233635
public function getParent()
    {
        if ($this->parent === null) {
            $this->setParent($this->environmentRepository->getParent($this));
        }
        return $this->parent;
    }
1034403
def get_parent(self):
        """"""
        if not self.has_cached_parent:
            if self.parent is not None:
                self._parent_block = self.runtime.get_block(self.parent)
            else:
                self._parent_block = None
            self._parent_block_id = self.parent
        return self._parent_block
601065
public Tree parent(Tree root) {
        List<Tree> kids = root.children();
        return traverse(root, kids, this);
    }
295271
@Override
  public PathImpl getParent()
  {
    if (_pathname.length() <= 1)
      return lookup("/");

    int length = _pathname.length();
    int lastSlash = _pathname.lastIndexOf('/');

    if (lastSlash < 1)
      return lookup("/");

    if (lastSlash == length - 1) {
      lastSlash = _pathname.lastIndexOf('/', length - 2);
      if (lastSlash < 1)
        return lookup("/");
    }

    return lookup(_pathname.substring(0, lastSlash));
  }
627246
public String getImageRoot()
    {
        if (_imageRoot != null)
            return _imageRoot;
        if (_parent != null)
            return _parent.getImageRoot();
        return null;
    }