IOPort port = (IOPort) ports.next();
int depth = port.getContainer().depthInHierarchy();
if (port.isInput()
&& (depth >= depthOfDirector)) {
result.addLast(port);
} else if (port.isOutput()
&& (depth < depthOfDirector)
&& (port.numberOfSinks() > 0)) {
result.addLast(port);
}