SDMCache class

Deprecated. since 3.0, Use Cache The SDMCache component is responsible for storing and accessing OData related objects in the memory of the device.

Syntax

public class SDMCache extends ISDMCache, ISDMPreferenceChangeListener, ISDMEntrySearch

Members

All members of SDMCache, including inherited members.

Variables
Modifier and Type Variable Description
public static final String ALL_ENTRY_SEARCH_TERM  
protected int cacheCapacity  
protected HashMap< String, Map< String, ISDMParserDocument > > collectionStore  
protected static final String ENTRY_KEY_ODATASCHEMA  
protected static final String ENTRY_KEY_ODATASERVICEDOCUMENT  
protected static final String ENTRY_TYPE_ODATAENTRY  
protected static final String ENTRY_TYPE_ODATASBASEDOCUMENT Search property tag to be used In the default cache search algorithm, this tag will be checked to identify the fields which are included in the search.
protected ISDMEntrySearch entrySearch  
protected ISDMLogger logger Logger object.
protected int maxSearchResult  
protected String mLogTag  
protected long mPerformanceTime  
protected long mTimerStart  
protected static final String NON_SAPDATA_DOCUMENTS_HASHMAP_KEY  
protected ISDMPreferences preferences  
protected ISDMODataSchema schema  
protected int searchAlgorythm  
protected String searchField  
protected ISDMODataServiceDocument serviceDocument  
Constructors Methods
Modifier and Type Method Description
protected void addSearchablePropertyPath(ISDMODataProperty, String, List< String[]>, String...)  
public void clear()  
protected Map< String, ISDMParserDocument > createStore()  
protected boolean fullTermContainSearch(String, ISDMODataEntry, List< String[]>)  
protected boolean fullTermPrefixSearch(String, ISDMODataEntry, List< String[]>)  
public ISDMEntrySearch getEntrySearch()  
public ISDMParserDocument getSDMODataDocument(String)  
public List< ISDMODataEntry > getSDMODataEntries(String)  
public ISDMODataEntry getSDMODataEntry(String)  
public ISDMODataSchema getSDMODataSchema()  
public ISDMODataServiceDocument getSDMODataServiceDocument()  
public int getSearchAlgorithm()  
public List< ISDMParserDocument > getStoredDocuments()  
public void onPreferenceChanged(String, Object)  
public void read(BufferedReader)  
protected boolean regexSearch(String, ISDMODataEntry)  
public boolean removeSDMODataDocument(String)  
public boolean removeSDMODataEntries(String)  
public void removeStoredDocuments()  
public boolean searchInEntry(String, String, List< String >, ISDMODataEntry, List< String[]>, int) Verifies whether the entry should be found during searching for the incoming search term.
public List< ISDMODataEntry > searchSDMODataEntries(String, String)  
public List< ISDMODataEntry > searchSDMODataEntries(String, String, int)  
public void setEntrySearch(ISDMEntrySearch)  
public void setSDMODataDocument(String, ISDMParserDocument)  
public void setSDMODataEntries(List< ISDMODataEntry >)  
public void setSDMODataEntry(ISDMODataEntry)  
public void setSDMODataSchema(ISDMODataSchema)  
public void setSDMODataServiceDocument(ISDMODataServiceDocument)  
public void setSearchAlgorithm(int)  
protected boolean tokenizedContainAllSearch(List< String >, ISDMODataEntry, List< String[]>)  
protected boolean tokenizedContainSearch(List< String >, ISDMODataEntry, List< String[]>)  
protected boolean tokenizedPrefixSearch(List< String >, ISDMODataEntry, List< String[]>)  
public void write(BufferedWriter)  
Inherited members from ISDMCache
Modifier and Type Member Description
public static final int DEFAULT_SEARCH Constant ID of default algorithm:
public static final int FULLTERM_CONTAIN_SEARCH Constant ID of Full Term Contain-search algorithm: Searching for the full search-term as a part of searchable values.
public static final int FULLTERM_PREFIX_SEARCH Constant ID of Full Term Prefix-search algorithm: Searching for the full search-term as a prefix of searchable values.
public static final int REGEX_SEARCH Constant ID of regex search algorithm.
public static final int TOKENIZED_CONTAIN_ALL_SEARCH Constant ID of All Token Contain-search algorithm: Searching for all the tokens of the search-term as a part of searchable values.
public static final int TOKENIZED_CONTAIN_SEARCH Constant ID of Tokenized Contain-search algorithm: Searching for all the tokens of the search-term as a part of searchable values.
public static final int TOKENIZED_PREFIX_SEARCH Constant ID of Tokenized Prefix-search algorithm: Searching for all the tokens of the search-term as a prefix of searchable values.
Inherited members from ISDMPersistable
Modifier and Type Member Description
public void read(BufferedReader)  
public void write(BufferedWriter)  

Usage

Technical Details: For capacity management, SDMCache uses an LRU (least recently used) like algorithm that ensures that the most recently used entries are not removed first because of reaching the maximum capacity. SDMCache currently supports only the tokenized prefix search as stated above. As a future improvement SDMCache is also going to support custom search logic. SDMCache is an implementer of the android.os.Parcelable interface provided by Android SDK. SDMCache depends on SAPData specific interfaces of SDMParser but does not depend on the real implementation of SDMParser.