public int remove ( String id ) throws Exception { id = Preconditions . checkNotNull ( id , "id cannot be null" ) ; queue . checkState ( ) ; int count = 0 ; for ( String name : queue . getChildren ( ) ) { if ( parseId ( name ) . id . equals ( id ) ) { if ( queue . tryRemove ( name ) ) { ++ count ; } } } return count ; }
Remove any items with the given Id