Search in sources :

Example 1 with HTMLTableRowElement

use of org.loboevolution.html.dom.HTMLTableRowElement in project LoboEvolution by LoboEvolution.

the class HTMLTableRowElementImpl method getRowIndex.

/**
 * {@inheritDoc}
 */
@Override
public int getRowIndex() {
    if (index >= 0) {
        return index;
    } else {
        AtomicInteger index = new AtomicInteger(-1);
        if (getParentNode() != null) {
            NodeListImpl childNodes = (NodeListImpl) getParentNode().getChildNodes();
            childNodes.forEach(node -> {
                if (node instanceof HTMLTableRowElement) {
                    index.incrementAndGet();
                }
            });
        }
        return index.get();
    }
}
Also used : HTMLTableRowElement(org.loboevolution.html.dom.HTMLTableRowElement) NodeListImpl(org.loboevolution.html.dom.nodeimpl.NodeListImpl) AtomicInteger(java.util.concurrent.atomic.AtomicInteger)

Aggregations

AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 HTMLTableRowElement (org.loboevolution.html.dom.HTMLTableRowElement)1 NodeListImpl (org.loboevolution.html.dom.nodeimpl.NodeListImpl)1