OracleJavaScript API Reference for Oracle ADF Faces

 

SUMMARY: FIELD | CONSTR | METHOD    DETAIL: FIELD | CONSTR | METHOD

oracle.adfinternal.view.js.data.inputSearch
Class AdfInputSearchMruCache

Warning:

org.ecmascript.object.Object
   |
   +--oracle.adf.view.js.base.AdfObject
         |
         +--oracle.adfinternal.view.js.data.inputSearch.AdfInputSearchMruCache

public class AdfInputSearchMruCache
extends AdfObject
Used by InputSearch's peer. Class to maintain the searchTerms -> {suggestions, isComprehensive} cache to determine if further filtering can be done on the client based on the suggestions already available on the client. The class provides get and put methods. Invoke the get method with searchTerms typed by the user to determine if the suggestions available on the client are sufficient to just perform client filtering.


Field Summary

private Object
_cache
private Object
_hasEmptySlots
public static Object
IS_COMPREHENSIVE
private Object
_oldestSlot
private static Object
_SEARCH_TERMS
private Object
_size
private static Object
_SPLIT_REGEX
public static Object
SUGGESTIONS

Fields inherited from oracle.adf.view.js.base.AdfObject

constructor, superclass

Fields inherited from org.ecmascript.object.Object

prototype

Constructor Summary

public
AdfInputSearchMruCache(Object size)
Used by InputSearch's peer.

Method Summary

public Array
get(String|Array searchTerms)
Returns the suggestions object and isComprehensive property for the searchTerms passed
public Array
getBestMatch(String|Array searchTerms)
Returns the best possible match for the searchTerms passed in the cache object.
private static Object
_getMatchCount(Object list1, Object list2)
Returns the count of the strings in list2 that startsWith strings in list1 Note:
private Object
_getNextIndex(Object index)
private Object
_getNextSlot()
Gets the next slot in the MRU cache where an element can be inserted
private Object
_getPreviousIndex(Object index)
private Object
_getRecentIndex()
Returns the most recent accessed index in the mru cache
protected Object
Init(Object size)
The size of the storage, the number of searchTerms and its corresponding suggestions result set to be cached.
protected static Object
InitClass()
private static Object
_isArrayEqual(Object list1, Object list2)
private Object
_isDuplicate(Object searchTerms)
Returns the index in the cache if the searchTerms or its subset already exists in the cache.
private static Object
_isSubset(Object list1, Object list2)
Checks if list1 is a subset of list2.
private Object
_promote(Object index)
Re-adjust the elements in the cache such that the item at the index passed becomes the most recent item.
public Object
put(String|Array searchTerms, AdfSuggestionMap suggestions, Boolean isComprehensive)
Adds the searchTerms -> {suggestions, isComprehensive} property to the MRU cache if it doesn't already exist, or moves it to the top of the mru list
static Object
__splitAndSort(Object str)
Splits the string passed on space character and sorts the resulting words based on lexicographic ordering

Methods inherited from oracle.adf.view.js.base.AdfObject

adopt, clone, createCallback, createInitializedObject, createSubclass, ensureClassInitialization, equals, exportPrototypeSymbol, getClass, GetLazyArrayProperty, GetLazyMapProperty, getTypeName, toDebugString, toString

Field Detail


_cache

private Object _cache

_hasEmptySlots

private Object _hasEmptySlots

IS_COMPREHENSIVE

public static Object IS_COMPREHENSIVE

_oldestSlot

private Object _oldestSlot

_SEARCH_TERMS

private static Object _SEARCH_TERMS

_size

private Object _size

_SPLIT_REGEX

private static Object _SPLIT_REGEX

SUGGESTIONS

public static Object SUGGESTIONS

Constructor Detail


AdfInputSearchMruCache

public AdfInputSearchMruCache(Object size)

Used by InputSearch's peer. Class to maintain the searchTerms -> {suggestions, isComprehensive} cache to determine if further filtering can be done on the client based on the suggestions already available on the client. The class provides get and put methods. Invoke the get method with searchTerms typed by the user to determine if the suggestions available on the client are sufficient to just perform client filtering.

Parameters:
size  

Method Detail


get

public Array get(String|Array searchTerms)

Returns the suggestions object and isComprehensive property for the searchTerms passed

Parameters:
searchTerms  
Return:
Array - Retrieve suggestions via AdfInputSearchMruCache.SUGGESTIONS key and isComprehensive property via AdfInputSearchMruCache.IS_COMPREHENSIVE key

getBestMatch

public Array getBestMatch(String|Array searchTerms)

Returns the best possible match for the searchTerms passed in the cache object. This method needs to be invoked only if #get method return no result, and so the returned array is always have isComprehensive property false.

Parameters:
searchTerms  
Return:
Array - Retrieve suggestions via AdfInputSearchMruCache.SUGGESTIONS key and isComprehensive property via AdfInputSearchMruCache.IS_COMPREHENSIVE key

_getMatchCount

private static Object _getMatchCount(Object list1,
                                     Object list2)

Returns the count of the strings in list2 that startsWith strings in list1 Note: Empty string is a startsWith match for all the strings.

Parameters:
list1  
list2  
Return:
Object

_getNextIndex

private Object _getNextIndex(Object index)

Parameters:
index  
Return:
Object

_getNextSlot

private Object _getNextSlot()

Gets the next slot in the MRU cache where an element can be inserted

Return:
Object

_getPreviousIndex

private Object _getPreviousIndex(Object index)

Parameters:
index  
Return:
Object

_getRecentIndex

private Object _getRecentIndex()

Returns the most recent accessed index in the mru cache

Return:
Object

Init

protected Object Init(Object size)

The size of the storage, the number of searchTerms and its corresponding suggestions result set to be cached.

Parameters:
size  
Return:
Object
Overrides:
AdfObject.Init()

InitClass

protected static Object InitClass()

Return:
Object

_isArrayEqual

private static Object _isArrayEqual(Object list1,
                                    Object list2)

Parameters:
list1  
list2  
Return:
Object

_isDuplicate

private Object _isDuplicate(Object searchTerms)

Returns the index in the cache if the searchTerms or its subset already exists in the cache.

Parameters:
searchTerms  
Return:
Object

_isSubset

private static Object _isSubset(Object list1,
                                Object list2)

Checks if list1 is a subset of list2. Useful to determine if this is a further filtering scenario of already cached item.

Parameters:
list1  
list2  
Return:
Object

_promote

private Object _promote(Object index)

Re-adjust the elements in the cache such that the item at the index passed becomes the most recent item.

Parameters:
index  
Return:
Object

put

public Object put(String|Array searchTerms,
                  AdfSuggestionMap suggestions,
                  Boolean isComprehensive)

Adds the searchTerms -> {suggestions, isComprehensive} property to the MRU cache if it doesn't already exist, or moves it to the top of the mru list

Parameters:
searchTerms  
suggestions  
isComprehensive  
Return:
Object

__splitAndSort

static Object __splitAndSort(Object str)

Splits the string passed on space character and sorts the resulting words based on lexicographic ordering

Parameters:
str  
Return:
Object

SUMMARY: FIELD | CONSTR | METHOD    DETAIL: FIELD | CONSTR | METHOD

 

Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.