private void replace(Node n1, Node n2, Integer date) {

	int id = outView.indexOf(n1);
	
	if( id < 0 )
	{
		System.err.println("Scamp.replace: node is not known");
		return;
	}

	// removing n1
	outView.remove(id);
	if( outViewDates != null ) outViewDates.remove(id);

	// inserting n2
	if( n2 != null )
	{
		if( (date != null && outViewDates == null) ||
		    (date == null && outViewDates != null) )
			throw new IllegalStateException(
				"is lease active or not?");
		
		int ins = outView.size();
		if( outViewDates != null )
		{
			ins = Collections.binarySearch( outViewDates, date );
			if( ins < 0 ) ins = -(ins+1);
			outViewDates.add(ins,date);
		}
		outView.add(ins,n2);
	}
}