/** * @return All iterable cells. Avoids copying the list. */ @Nonnull public Iterable <IHCCell <?>> getAllCellsIterable () { return directGetAllChildren (); }
/** * Count the number of effective cells - including "colspans" - of this row. * * @return The number of effectively contained cells. Always ≥ 0. */ @Nonnegative public int getEffectiveCellCount () { int ret = 0; if (hasChildren ()) for (final IHCCell <?> aCell : directGetAllChildren ()) ret += aCell.getColspan (); return ret; }
/** * @return <code>true</code> if at least one contained cell uses a rowspan. */ public boolean isRowspanUsed () { if (hasChildren ()) for (final IHCCell <?> aCell : directGetAllChildren ()) if (aCell.getRowspan () > 1) return true; return false; }
/** * @return <code>true</code> if at least one contained cell uses a colspan. */ public boolean isColspanUsed () { if (hasChildren ()) for (final IHCCell <?> aCell : directGetAllChildren ()) if (aCell.getColspan () > 1) return true; return false; }
/** * Get the cell at the specified index in this row. This method does consider * colspans!!!! * * @param nIndex * The index of the cell. Should be ≥ 0. * @return <code>null</code> if no such cell is present */ @Nullable public IHCCell <?> getCellAtEffectiveIndex (final int nIndex) { int i = 0; if (hasChildren ()) for (final IHCCell <?> aCell : directGetAllChildren ()) { if (i >= nIndex) return aCell; i += aCell.getColspan (); } return null; }
/** * @return All cell nodes as one big {@link HCNodeList}. Never * <code>null</code>. */ @Nonnull public HCNodeList getCellsAsNodeList () { final HCNodeList ret = new HCNodeList (); if (hasChildren ()) for (final IHCCell <?> aCell : directGetAllChildren ()) ret.addChild (aCell); return ret; }