Verifies whether child is a child (dir or file) of parent
@param parent
@param child
@return True if child is a child, false otherwise
558968
protected static boolean isChildOf(String parent, String child) {
        if(parent == null || child == null)
            return false;
        if(!child.startsWith(parent))
            return false;
        if(child.length() <= parent.length())
            return false;
        int from=parent.equals(File.separator)? parent.length() : parent.length() +1;
        //  if(from-1 > child.length())
            // return false;
        String[] comps=Util.components(child.substring(from), File.separator);
        return comps != null && comps.length <= 1;
    }
418136
private TreeNode getParentTreeNode(TreeNode child) {
        TreeNode parentTreeNode = parentIndex.get(child);

        if (parentTreeNode == null)
            return null;

        // Makes sure the parent node is still present in the tree
        else if (contains(parentTreeNode.getQueryNode()))
            return parentTreeNode;
        else
            throw new RuntimeException("Internal error: points to a parent that is not (anymore) in the tree");
    }
1008811
public function isDescendantOf(ChildCategory $parent)
    {
        return $this->isInTree() && $this->getLeftValue() > $parent->getLeftValue() && $this->getRightValue() < $parent->getRightValue();
    }
453974
public static boolean containsFileRecursive(final File parent, final File search)
	{
		final File toSearch = search.getAbsoluteFile();
		boolean exists = false;
		final File[] children = parent.getAbsoluteFile().listFiles();
		if (children == null)
		{
			return false;
		}
		final List<File> fileList = Arrays.asList(children);
		for (final File currentFile : fileList)
		{
			if (currentFile.isDirectory())
			{
				exists = FileSearchExtensions.containsFileRecursive(currentFile, toSearch);
				if (exists)
				{
					return true;
				}
			}
			if (fileList.contains(toSearch))
			{
				return true;
			}
		}
		return exists;
	}
10849
public final boolean isParentItem(int adapterPosition) {
        int itemCount = 0;

        int parentCount = parentItemCount();
        for (int i = 0; i < parentCount; i++) {
            if (itemCount == adapterPosition) {
                return true;
            }

            itemCount += 1;

            if (isExpanded(i)) {
                itemCount += childItemCount(i);
            } else {
                // itemCount += 1;
            }
        }

        return false;
    }
450750
public static boolean isFile(Resource resource) {
        return resource.isResourceType(ResourceUtil.TYPE_FILE) ||
                resource.isResourceType(ResourceUtil.TYPE_LINKED_FILE);
    }
791905
function (element, child) {
    if (element === document) {
      element = document.documentElement || document.body.parentElement
    }
    while (child) {
      if (element === child) {
        return true
      }
      child = child.parentElement
    }
    return false
  }
696366
private boolean isChildAllowed(final InternalQName childName, final InternalQName childNodeType,
      final NodeDefinitionData cnd, InternalQName reqName, final InternalQName reqNodeType)
   {
      return childNodeType.equals(reqNodeType) && (cnd.isResidualSet() || reqName.equals(childName));
   }
289315
public boolean isChildOf(GeometryIndex parentIndex, GeometryIndex childIndex) {
		if (parentIndex.getValue() != childIndex.getValue()) {
			return false;
		}
		if (parentIndex.hasChild() && childIndex.hasChild()) {
			return isChildOf(parentIndex.getChild(), childIndex.getChild());
		} else if (!parentIndex.hasChild() && childIndex.hasChild()) {
			return true;
		}
		return false;
	}
1050003
public static boolean containsFile(final File parent, final File search)
	{
		boolean exists = false;
		final String[] children = parent.list();
		if (children == null)
		{
			return false;
		}
		final List<String> fileList = Arrays.asList(children);
		if (fileList.contains(search.getName()))
		{
			exists = true;
		}
		return exists;
	}
1144272
private boolean hasSelectedChildren(List<CmsCategoryTreeEntry> children, Collection<String> selectedCategories) {

        boolean result = false;
        if (children == null) {
            return false;
        }
        for (CmsCategoryTreeEntry child : children) {
            result = selectedCategories.contains(child.getSitePath());
            if (result || hasSelectedChildren(child.getChildren(), selectedCategories)) {
                return true;
            }
        }

        return result;
    }
465822
private boolean isChild(Node cn, Node cn2) {
        if (cn == cn2)
            return false;

        Queue<Node> toProcess = new LinkedList<Node>();
        toProcess.addAll(cn.getParents());

        while (!toProcess.isEmpty()) {
            Node tcn = toProcess.poll();
            if (tcn.equals(cn2))
                return true;
            Set<Node> parents = tcn.getParents();
            if (parents != null && !parents.isEmpty())
                toProcess.addAll(parents);
        }

        return false;
    }
65525
public boolean removeChild( PlanNode child ) {
        boolean result = this.children.remove(child);
        if (result) {
            child.parent = null;
        }
        return result;
    }
925228
public boolean removeChild( AstNode child ) {
        boolean result = this.children.remove(child);
        if (result) {
            child.parent = null;
        }
        return result;
    }
428657
@Override
	public boolean isChildProperty() {

		Field fieldAnnotation = getFieldAnnotation();

		if (fieldAnnotation != null && fieldAnnotation.child()) {
			return true;
		}

		return findAnnotation(ChildDocument.class) != null;
	}
41827
final void checkChildScope(S parent) {
    checkNotNull(parent);
    checkArgument(NodeUtil.createsScope(rootNode), rootNode);
    checkArgument(
        rootNode != parent.getRootNode(),
        "rootNode should not be the parent's root node: %s", rootNode);
  }
922098
public static boolean isSubPath(File parent, File child) throws IOException {
    String childStr = child.getCanonicalPath();
    String parentStr = parent.getCanonicalPath();

    return childStr.startsWith(parentStr);
  }