|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.5.0) E13403-06 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.javatools.editor.insight.InsightInputFilter
oracle.javatools.editor.insight.SortedInsightInputFilter
public final class SortedInsightInputFilter
This class defines the filtering of an insight list based on pure prefix match.
This is a singleton class accessible through INSTANCE
Field Summary | |
---|---|
static ListDataItem[] |
EMPTY_LIST Singleton empty list. |
static SortedInsightInputFilter |
INSTANCE The CamelCaseInsightInputFilter class is a singleton. |
Method Summary | |
---|---|
ListDataItem |
findClosestDataItem(ListDataItem[] dataList, java.lang.String name) Utility routine to find the ListDataItem with display name, as returned by getName() that is closest to the provided name. |
java.lang.String |
findCommonPrefix(ListDataItem[] dataList, java.lang.String name) Utility routine to find the common prefix of ListDataItems the data list that begin with the specified name. |
ListDataItem[] |
getMatchingData(ListDataItem[] dataList, java.lang.String prefix) Utility routine which fetches the subset of data items in this list model that starts with the given prefix specified. |
protected void |
sortData(ListDataItem[] dataList) |
static boolean |
startsWithIgnoreCase(java.lang.String name1, java.lang.String name2) Utility routine to check whether the first name starts with the second name, using case-insensitive comparison rules ("AA" == 'aa'). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final SortedInsightInputFilter INSTANCE
public static final ListDataItem[] EMPTY_LIST
Method Detail |
---|
protected void sortData(ListDataItem[] dataList)
sortData
in class InsightInputFilter
public ListDataItem findClosestDataItem(ListDataItem[] dataList, java.lang.String name)
InsightInputFilter
ListDataItem
with display name, as returned by getName()
that is closest to the provided name. For example, suppose the user had the following items in the list:
If the passed in name is "equalsFoo()", the data item returned will be "equalsIgnoreCase()". If the passed in name is "regionMatches()", the data item returned will be "substring()".
This utility routine can be used by clients to help locate the closest data item that should be selected in an insight list so that the list tracks what the user is typing.
findClosestDataItem
in class InsightInputFilter
name
- the display name to find the closest data item forpublic ListDataItem[] getMatchingData(ListDataItem[] dataList, java.lang.String prefix)
For example, suppose the data list contains the following:
Then there are 3 items which match the prefix "eq", and this routine will return an array of those 3 items. Note that if the prefix is an empty string, "", then all items will be returned. If there are no items that start with the specified prefix, an empty array will be returned.
getMatchingData
in class InsightInputFilter
prefix
- the prefix to search for matching itemspublic java.lang.String findCommonPrefix(ListDataItem[] dataList, java.lang.String name)
ListDataItems
the data list that begin with the specified name. As with findClosestDataItem()
, the name of the ListDataItem
used is what is returned by getName()
.
Note that a case-insensitive comparison is used for determining the common prefix. Also, of the data items that start with the specified name, the common prefix is taken from the first data item. So for example, if the specified name is "eq", and the following data items are in the list:
Then the common prefix is "equals", and since the first data item is "EQUALS_SOMETHING", the common prefix returned will be "EQUALS".
If there are no items that start with the specified name, an empty (zero-length) String will be returned.
findCommonPrefix
in class InsightInputFilter
public static boolean startsWithIgnoreCase(java.lang.String name1, java.lang.String name2)
this.startsWith(that)
, name1 is this
, and name2 is that
.name1
- the name to see if it starts with name2name2
- the name to see if name1 starts with
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.5.0) E13403-06 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |