public boolean removeMap ( String attribute , String key ) { NameOpValue nv = rslTree . getParam ( attribute ) ; if ( nv == null || nv . getOperator ( ) != NameOpValue . EQ ) return false ; List values = nv . getValues ( ) ; Iterator iter = values . iterator ( ) ; Object obj ; int i = 0 ; int found = - 1 ; while ( iter . hasNext ( ) ) { obj = iter . next ( ) ; if ( obj instanceof List ) { List vr = ( List ) obj ; if ( vr . size ( ) > 0 ) { Object var = vr . get ( 0 ) ; if ( var instanceof Value && ( ( Value ) var ) . getValue ( ) . equals ( key ) ) { found = i ; break ; } } } i ++ ; } if ( found != - 1 ) { values . remove ( found ) ; return true ; } else { return false ; } }
Removes a specific key from a list of values of the specified attribute . The attribute values must be in the right form . See the environment rsl attribute .