Home | History | Annotate | Download | only in indexing
      1 /*
      2  * Copyright (C) 2017 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  *
     16  */
     17 
     18 package com.android.settings.search.indexing;
     19 
     20 import android.provider.SearchIndexableData;
     21 
     22 import java.util.ArrayList;
     23 import java.util.HashMap;
     24 import java.util.List;
     25 import java.util.Map;
     26 import java.util.Set;
     27 
     28 
     29 /**
     30  * Holds Data sources for indexable data.
     31  * TODO (b/33577327) add getters and setters for data.
     32  */
     33 public class PreIndexData {
     34     public List<SearchIndexableData> dataToUpdate;
     35     public Map<String, Set<String>> nonIndexableKeys;
     36 
     37     public PreIndexData() {
     38         dataToUpdate = new ArrayList<>();
     39         nonIndexableKeys = new HashMap<>();
     40     }
     41 
     42     public PreIndexData(PreIndexData other) {
     43         dataToUpdate = new ArrayList<>(other.dataToUpdate);
     44         nonIndexableKeys = new HashMap<>(other.nonIndexableKeys);
     45     }
     46 
     47     public PreIndexData copy() {
     48         return new PreIndexData(this);
     49     }
     50 
     51     public void clear() {
     52         dataToUpdate.clear();
     53         nonIndexableKeys.clear();
     54     }
     55 }
     56