public void removeTopic ( String topic ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "removeTopic" , topic ) ; SelectionCriteria [ ] tmp = selectionCriteriaList ; // Loop through the selectionCriteriaList for ( int i = 0 ; i < selectionCriteriaList . length ; ++ i ) { if ( ( selectionCriteriaList [ i ] . getDiscriminator ( ) == null && topic == null ) || ( topic != null && selectionCriteriaList [ i ] . getDiscriminator ( ) . equals ( topic ) ) ) { // If there was only one criteria and we have removed it then // nullify lists if ( selectionCriteriaList . length == 1 ) { selectionCriteriaList = null ; topics = null ; } else { // The criteria match, so resize the array without this // criteria in it. tmp = new SelectionCriteria [ selectionCriteriaList . length - 1 ] ; System . arraycopy ( selectionCriteriaList , 0 , tmp , 0 , i ) ; System . arraycopy ( selectionCriteriaList , i + 1 , tmp , i , selectionCriteriaList . length - i - 1 ) ; selectionCriteriaList = tmp ; // And copy into the topics array so that they always match this . topics = new String [ selectionCriteriaList . length ] ; for ( int t = 0 ; t < selectionCriteriaList . length ; t ++ ) { topics [ t ] = ( selectionCriteriaList [ t ] == null ) ? null : selectionCriteriaList [ t ] . getDiscriminator ( ) ; } } break ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "removeTopic" ) ; }
Remove a topic from the array of topics