Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

oracle.javatools.editor.insight
Class InsightInputFilter

java.lang.Object
  extended by oracle.javatools.editor.insight.InsightInputFilter
Direct Known Subclasses:
CamelCaseInsightInputFilter, SortedInsightInputFilter

public abstract class InsightInputFilter
extends java.lang.Object

This class defines the filtering of an insight list based on the user input.


Constructor Summary
InsightInputFilter()
           
 
Method Summary
abstract  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.
abstract  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.
abstract  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 abstract  void sortData(ListDataItem[] dataList)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InsightInputFilter

public InsightInputFilter()
Method Detail

sortData

protected abstract void sortData(ListDataItem[] dataList)

findClosestDataItem

public abstract 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. 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.

Parameters:
name - the display name to find the closest data item for
Returns:
the data item with display name closest to the one passed in, or if not found, one that follows where the display name would sort into

getMatchingData

public abstract 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. 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.

Parameters:
prefix - the prefix to search for matching items
Returns:
an array of items that each start with the specified prefix

findCommonPrefix

public abstract 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. As with findClosestDataItem(), the name of the ListDataItem used is what is returned by getName().

If there are no items that start with the specified name, an empty (zero-length) String will be returned.


Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

Copyright © 1997, 2011, Oracle. All rights reserved.