Code example for HashMap

Methods: containsKey, remove

0
    public int delete(Uri uri, String selection, String[] selectionArgs) {
        if (selection != null || selectionArgs != null) {
            throw new UnsupportedOperationException();
        } 
        String path = uri.getPath();
        if (mMockStore.containsKey(path)) {
            mMockStore.remove(path);
            return 1; 
        } else { 
            return 0; 
        } 
    } 
 
    @Override 
    public String getType(Uri uri) {
        throw new UnsupportedOperationException();
    } 
 
    @Override 
    public Uri insert(Uri uri, ContentValues values) {
        // Remove the leading slash