public Object remove ( Object key ) { Object retVal = null ; if ( null == key ) throw new IllegalArgumentException ( "key must not be null" ) ; if ( this . containsKey ( key ) ) { retVal = super . remove ( key ) ; for ( int i = 0 ; i < this . order . size ( ) ; i ++ ) { Object obj = this . order . get ( i ) ; if ( obj . equals ( key ) ) { this . order . remove ( i ) ; break ; } } } return retVal ; }
Method to remove an entry from the OrderedJSONObject instance .