public void update ( int element , double priority ) { this . doImport ( element ) ; final double q = this . prior . get ( element ) ; if ( Double . compare ( q , priority ) == 0 ) return ; this . prior . set ( element , priority ) ; if ( this . pos . get ( element ) < 0 ) return ; if ( priority < q ) this . down ( element ) ; if ( q < priority ) this . up ( element ) ; }
Updated the priority of a given element .