* @return The rows directly contained by this table.
*/
public TableRow[] getRows ()
{
NodeList kids;
NodeClassFilter cls;
HasParentFilter recursion;
NodeFilter filter;
TableRow[] ret;
kids = getChildren ();
if (null != kids)
{
cls = new NodeClassFilter (TableTag.class);
recursion = new HasParentFilter (null);
filter = new OrFilter (
new AndFilter (
cls,
new IsEqualFilter (this)),
new AndFilter ( // recurse up the parent chain
new NotFilter (cls), // but not past the first table
recursion));
recursion.setParentFilter (filter);
kids = kids.extractAllNodesThatMatch (
// it's a row, and has this table as it's enclosing table
new AndFilter (
new NodeClassFilter (TableRow.class),
filter), true);
ret = new TableRow[kids.size ()];
kids.copyToNodeArray (ret);
}
else