public void updateLabel ( String oldLabel , String newLabel ) { if ( hasLabel ( newLabel ) ) throw new IllegalArgumentException ( "The label \"" + newLabel + "\" already exists." ) ; int i = indexOf ( oldLabel ) ; labelMap . remove ( oldLabel ) ; labelMap . put ( newLabel , i ) ; }
Changes a label . The oldLabel has to be an existing label and new label has to be a new label .