return "(nodeDepth " + nodeDepth.getSelectorName() + ")";
}
};
}
if (operand instanceof ChildCount) {
final ChildCount childCount = (ChildCount)operand;
final int indexInRow = columns.getSelectorIndex(childCount.getSelectorName());
final NodeCache cache = context.getNodeCache(sources.getWorkspaceName());
final TypeFactory<?> longType = context.getTypeSystem().getLongFactory();
return new ExtractFromRow() {
@Override
public TypeFactory<?> getType() {
return longType; // count is always a long type
}
@Override
public Object getValueInRow( RowAccessor row ) {
CachedNode node = row.getNode(indexInRow);
if (node == null) return null;
return new Long(node.getChildReferences(cache).size());
}
@Override
public String toString() {
return "(childCount " + childCount.getSelectorName() + ")";
}
};
}
if (operand instanceof NodeId) {
final NodeId nodeId = (NodeId)operand;