public boolean remove ( DATA data ) { if ( root == null ) { return false ; } double distanceToRoot = distanceFunction . calculate ( data , root . data ) ; try { root . removeData ( data , distanceToRoot ) ; } catch ( RootNodeReplacement e ) { @ SuppressWarnings ( "unchecked" ) Node newRoot = ( Node ) e . newRoot ; root = newRoot ; } catch ( DataNotFound e ) { return false ; } catch ( NodeUnderCapacity e ) { throw new RuntimeException ( "Should have never happened" , e ) ; } return true ; }
Removes a data object from the M - Tree .