if (edges[i].contents instanceof SIRJoiner) {
if (edges[i]!=null && edges[i].contents instanceof SIRJoiner) {
    public int getNumTiles() {	int count = 0;	for (Iterator it = SIRMap.entrySet().iterator(); it.hasNext(); ) {	    Map.Entry entry = (Map.Entry)it.next();	    if (entry.getKey() instanceof SIRFilter) {		// always count filter		count++;	    } else if (entry.getKey() instanceof SIRJoiner) {		// count a joiner if none of its outgoing edges is to		// another joiner		FlatNode[] edges = ((FlatNode)entry.getValue()).edges;		int increment = 1;		for (int i=0; i<edges.length; i++) {		    if (edges[i].contents instanceof SIRJoiner) {			increment = 0;		    }		}		count += increment;	    } 	}	return count;    }