public void replace ( Token original , Token target ) { if ( first == original ) first = target ; if ( last == original ) last = target ; target . next = original . next ; target . previous = original . previous ; if ( original . next != null ) original . next . previous = target ; if ( original . previous != null ) original . previous . next = target ; original . next = original . previous = null ; }
Removes original and places target at the same location