com.googlecode.wicket.jquery.ui.form.autocomplete
Class AutoCompleteUtils

java.lang.Object
  extended by com.googlecode.wicket.jquery.ui.form.autocomplete.AutoCompleteUtils

public class AutoCompleteUtils
extends Object

Provides simple utils that can be used in AutoCompleteTextField.getChoices(String)

Author:
Sebastien Briquet - sebfz1

Constructor Summary
AutoCompleteUtils()
           
 
Method Summary
static
<T> List<T>
contains(String search, List<T> list)
          Returns a sub list of items of type T having their textual representation (toString()) containing the search criteria
The max size of the sub list is MAX
static
<T> List<T>
contains(String search, List<T> list, int max)
          Returns a sub list of items of type T having their textual representation (toString()) containing the search criteria
static
<T> List<T>
startsWith(String search, List<T> list)
          Returns a sub list of items of type T having their textual representation (toString()) starting with the search criteria
The max size of the sub list is MAX
static
<T> List<T>
startsWith(String search, List<T> list, int max)
          Returns a sub list of items of type T having their textual representation (toString()) starting with the search criteria
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutoCompleteUtils

public AutoCompleteUtils()
Method Detail

contains

public static <T> List<T> contains(String search,
                                   List<T> list)
Returns a sub list of items of type T having their textual representation (toString()) containing the search criteria
The max size of the sub list is MAX

Type Parameters:
T - the type
Parameters:
search - search criteria
list - reference list
Returns:
the sub list

contains

public static <T> List<T> contains(String search,
                                   List<T> list,
                                   int max)
Returns a sub list of items of type T having their textual representation (toString()) containing the search criteria

Type Parameters:
T - the type
Parameters:
search - search criteria
list - reference list
max - max size of the sub list to be returned
Returns:
the sub list

startsWith

public static <T> List<T> startsWith(String search,
                                     List<T> list)
Returns a sub list of items of type T having their textual representation (toString()) starting with the search criteria
The max size of the sub list is MAX

Type Parameters:
T - the type
Parameters:
search - search criteria
list - reference list
Returns:
the sub list

startsWith

public static <T> List<T> startsWith(String search,
                                     List<T> list,
                                     int max)
Returns a sub list of items of type T having their textual representation (toString()) starting with the search criteria

Type Parameters:
T - the type
Parameters:
search - search criteria
list - reference list
max - max size of the sub list to be returned
Returns:
the sub list


Copyright © 2013 7thWeb. All Rights Reserved.