tail.setParent(this);
    public int finish() {	int size=0;	TraceNode node=head;	if(node instanceof InputTraceNode)	    node=node.getNext();	TraceNode end=node;	while(node!=null&&node instanceof FilterTraceNode) {	    size++;	    end=node;	    node=node.getNext();	}	if(node!=null)	    end=node;	len=size;	if(end instanceof OutputTraceNode)	    tail=(OutputTraceNode)end;	else {	    tail=new OutputTraceNode();	    end.setNext(tail);	    tail.setPrevious(end);	}	return size;    }