Class DefaultSearchHistory
- java.lang.Object
-
- com.e1c.g5.v8.dt.lcore.ui.templates.preferences.DefaultSearchHistory
-
- All Implemented Interfaces:
ISearchHistory
public class DefaultSearchHistory extends Object implements ISearchHistory
Default implementation ofISearchHistory
. UsesLinkedHashMap
to store history.
-
-
Field Summary
-
Fields inherited from interface com._1c.g5.v8.dt.common.ui.controls.search.ISearchHistory
ALL_PATTERNS
-
-
Constructor Summary
Constructors Constructor Description DefaultSearchHistory(int maxCapacity)
Creates new DefaultSearchHistory with given history capacity
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getActivePattern()
List<String>
getRecentPatterns(int count)
Return recent history patterns.void
savePattern(String value)
Saves pattern in the history.
-
-
-
Method Detail
-
savePattern
public void savePattern(String value)
Description copied from interface:ISearchHistory
Saves pattern in the history.- Specified by:
savePattern
in interfaceISearchHistory
- Parameters:
value
- pattern to save.
-
getActivePattern
public String getActivePattern()
- Specified by:
getActivePattern
in interfaceISearchHistory
- Returns:
- active pattern or empty string if there is no one.
-
getRecentPatterns
public List<String> getRecentPatterns(int count)
Description copied from interface:ISearchHistory
Return recent history patterns. UseISearchHistory.ALL_PATTERNS
to obtain all patterns stored in the history.- Specified by:
getRecentPatterns
in interfaceISearchHistory
- Parameters:
count
- maximum number of patterns to return.- Returns:
- recent patterns or empty iterable if there are no patterns.
-
-