Item is a parent item.

@param adapterPosition adapter position.

@return true, otherwise is false.
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;
    }
17021
public boolean isParentOf(ConfigurationPropertyName name) {
		Assert.notNull(name, "Name must not be null");
		if (this.getNumberOfElements() != name.getNumberOfElements() - 1) {
			return false;
		}
		return isAncestorOf(name);
	}
626095
public final boolean isItemInsideView(int position) {
    float x = (getXForItemAtPosition(position) + offsetX);
    float y = (getYForItemAtPosition(position) + offsetY);
    float itemSize = getNoxItemSize();
    int viewWidth = shapeConfig.getViewWidth();
    boolean matchesHorizontally = x + itemSize >= 0 && x <= viewWidth;
    float viewHeight = shapeConfig.getViewHeight();
    boolean matchesVertically = y + itemSize >= 0 && y <= viewHeight;
    return matchesHorizontally && matchesVertically;
  }
27268
public int getPosition(Item item) {
        if (item.getIdentifier() == -1) {
            Log.e("FastAdapter", "You have to define an identifier for your item to retrieve the position via this method");
            return -1;
        }
        return getPosition(item.getIdentifier());
    }
319598
public Object getItemAtPosition(int position) {
        T adapter = getAdapter();
        return (adapter == null || position < 0) ? null : adapter.getItem(position);
    }
988280
protected void removeBy(int position) {
        if (mGroupBasicAdapter != null) {
            if (position < mGroupBasicAdapter.getItemCount() && position >= 0) {
                BaseCell removeCell = mGroupBasicAdapter.getItemByPosition(position);
                removeBy(removeCell);
            }
        }
    }
835363
private static boolean isNotReparentable(
            NodeInfo ni, Element compViewParent, Element positionSet) {

        // This one is easy -- can't re-parent a node with dlm:moveAllowed=false
        if (ni.getNode().getAttribute(Constants.ATT_MOVE_ALLOWED).equals("false")) {
            return true;
        }

        try {
            /*
             *  Annoying to do in Java, but we need to find our own placeholder
             *  element in the positionSet
             */
            final XPathFactory xpathFactory = XPathFactory.newInstance();
            final XPath xpath = xpathFactory.newXPath();
            final String findPlaceholderXpath =
                    ".//*[local-name()='position' and @name='" + ni.getId() + "']";
            final XPathExpression findPlaceholder = xpath.compile(findPlaceholderXpath);
            final NodeList findPlaceholderList =
                    (NodeList) findPlaceholder.evaluate(positionSet, XPathConstants.NODESET);
            switch (findPlaceholderList.getLength()) {
                case 0:
                    LOG.warn(
                            "Node not found for XPathExpression=\""
                                    + findPlaceholderXpath
                                    + "\" in positionSet="
                                    + XmlUtilitiesImpl.toString(positionSet));
                    return true;
                case 1:
                    // This is healthy
                    break;
                default:
                    LOG.warn(
                            "More than one node found for XPathExpression=\""
                                    + findPlaceholderXpath
                                    + "\" in positionSet="
                                    + XmlUtilitiesImpl.toString(positionSet));
                    return true;
            }
            final Element placeholder = (Element) findPlaceholderList.item(0); // At last

            for (Element nextPlaceholder =
                            (Element)
                                    placeholder
                                            .getNextSibling(); // Start with the next dlm:position
                    // element after placeholder
                    nextPlaceholder != null; // As long as we have a placeholder to look at
                    nextPlaceholder =
                            (Element)
                                    nextPlaceholder
                                            .getNextSibling()) { // Advance to the next placeholder

                if (LOG.isDebugEnabled()) {
                    LOG.debug(
                            "Considering whether node ''"
                                    + ni.getId()
                                    + "' is Reparentable;  subsequent sibling is:  "
                                    + nextPlaceholder.getAttribute("name"));
                }

                /*
                 * Next task:  we have to find the non-placeholder representation of
                 * the nextSiblingPlaceholder within the compViewParent
                 */
                final String unmaskPlaceholderXpath =
                        ".//*[@ID='" + nextPlaceholder.getAttribute("name") + "']";
                final XPathExpression unmaskPlaceholder = xpath.compile(unmaskPlaceholderXpath);
                final NodeList unmaskPlaceholderList =
                        (NodeList)
                                unmaskPlaceholder.evaluate(compViewParent, XPathConstants.NODESET);
                switch (unmaskPlaceholderList.getLength()) {
                    case 0:
                        // Not a problem;  the nextSiblingPlaceholder also refers
                        // to a node that has been moved to this context (afaik)
                        continue;
                    case 1:
                        final Element nextSibling = (Element) unmaskPlaceholderList.item(0);
                        if (LOG.isDebugEnabled()) {
                            LOG.debug(
                                    "Considering whether node ''"
                                            + ni.getId()
                                            + "' is Reparentable;  subsequent sibling '"
                                            + nextSibling.getAttribute("ID")
                                            + "' has dlm:moveAllowed="
                                            + !nextSibling
                                                    .getAttribute(Constants.ATT_MOVE_ALLOWED)
                                                    .equals("false"));
                        }

                        // Need to perform some checks...
                        if (nextSibling.getAttribute(Constants.ATT_MOVE_ALLOWED).equals("false")) {

                            /*
                             *  The following check is a bit strange;  it seems to verify
                             *  that the current NodeInfo and the nextSibling come from the
                             *  same fragment.  If they don't, the re-parenting is allowable.
                             *  I believe this check could only be unsatisfied in the case
                             *  of tabs.
                             */
                            Precedence p =
                                    Precedence.newInstance(
                                            nextSibling.getAttribute(Constants.ATT_FRAGMENT));
                            if (ni.getPrecedence().isEqualTo(p)) {
                                return true;
                            }
                        }
                        break;
                    default:
                        LOG.warn(
                                "More than one node found for XPathExpression=\""
                                        + unmaskPlaceholderXpath
                                        + "\" in compViewParent");
                        return true;
                }
            }
        } catch (XPathExpressionException xpe) {
            throw new RuntimeException("Failed to evaluate XPATH", xpe);
        }

        return false; // Re-parenting is "not disallowed" (double-negative less readable)
    }
1318401
function isAttachedToRoot() {
         if (this.root === true) {
           return true;
         } else {
           var ancestor = this.ancestor;

           while (ancestor) {
             if (ancestor.root === true) {
               return true;
             }

             ancestor = ancestor.ancestor;
           }

           return false;
         }
       }
409837
public boolean isChildOf(NameSpace parent) {
        return null != this.getParent() && (
                this.getParent().equals(parent)
             || this.getParent().isChildOf(parent));
    }
1038780
@Deprecated
    @SuppressWarnings("unchecked")
    public static void deselect(final FastAdapter adapter) {
        adapter.recursive(new AdapterPredicate() {
            @Override
            public boolean apply(@NonNull IAdapter lastParentAdapter, int lastParentPosition, @NonNull IItem item, int position) {
                if (position != -1) {
                    SelectExtension extension = (SelectExtension) adapter.getExtension(SelectExtension.class);
                    if (extension != null) {
                        extension.deselect(position);
                    }
                } else {
                    item.withSetSelected(false);
                }
                return true;
            }
        }, false);
    }
856136
private static boolean parentExists(Resource res) {
	res = res.getParentResource();
	return res != null && res.exists();
    }
1111272
public boolean parent() {
        if (mNode == null) {
            return false;
        }
        AccessibilityNodeInfoCompat parentNode = mNode.getParent();
        while (parentNode != null) {
            if (AccessibilityNodeInfoUtils.isVisibleOrLegacy(parentNode)) {
                reset(parentNode);
                return true;
            }
            AccessibilityNodeInfoCompat tmp = parentNode.getParent();
            parentNode.recycle();
            parentNode = tmp;
        }
        return false;
    }
81613
public int getChildPosition(View child) {
        final ViewHolder holder = getChildViewHolderInt(child);
        return holder != null ? holder.getPosition() : NO_POSITION;
    }
820875
private void openParents(CmsTreeItem item) {

        if (item != null) {
            item.setOpen(true);
            openParents(item.getParentItem());
        }
    }
163490
@UiThread
    private int getFlatParentPosition(int parentPosition) {
        int parentCount = 0;
        int listItemCount = mFlatItemList.size();
        for (int i = 0; i < listItemCount; i++) {
            if (mFlatItemList.get(i).isParent()) {
                parentCount++;

                if (parentCount > parentPosition) {
                    return i;
                }
            }
        }

        return INVALID_FLAT_POSITION;
    }
947823
public void setCurrentPosition(int position, boolean smooth) {
        if (getRealAdapter() == null)
            throw new IllegalStateException("You did not set a slider adapter");
        if(position >= getRealAdapter().getCount()){
            throw new IllegalStateException("Item position is not exist");
        }
        int p = mViewPager.getCurrentItem() % getRealAdapter().getCount();
        int n = (position - p) + mViewPager.getCurrentItem();
        mViewPager.setCurrentItem(n, smooth);
    }
1220913
protected static boolean isChildOf(String parent, String child) {
      if (parent == null || child == null)
         return false;
      if (!child.startsWith((parent.endsWith(SEPARATOR) ? parent : parent + SEPARATOR)))
         return false;
      if (child.length() <= parent.length())
         return false;
      int from = parent.equals(SEPARATOR) ? parent.length() : parent.length() + 1;
      //  if(from-1 > child.length())
      // return false;
      String[] comps = Util.components(child.substring(from), SEPARATOR);
      return comps != null && comps.length <= 1;
   }