public class KeyValueListFilter<RecordType>
extends java.lang.Object
Constructor and Description |
---|
KeyValueListFilter(KeyValueAdaptor adaptor,
java.util.List<RecordType> allRecords,
java.lang.String... matchingKeyPaths)
Primary Constructor
|
Modifier and Type | Method and Description |
---|---|
java.util.List<RecordType> |
filterRecords(java.lang.String text)
Filter the records for those that match (case insensitive) every word in the specified text.
|
void |
filterRecordsTo(java.lang.String text,
java.util.List<RecordType> matchingRecords)
Filter the records for those that match (case insensitive) every word in the specified text.
|
void |
indexRecords()
index all records by the keyed values in the list
|
void |
reIndexRecord(RecordType record)
re-index the specified record (e.g.
|
void |
setAllRecords(java.util.List<RecordType> allRecords)
Set the list of all objects to filter
|
void |
setMatchingKeyPaths(java.lang.String... matchingKeyPaths)
Set the matching key paths
|
public KeyValueListFilter(KeyValueAdaptor adaptor, java.util.List<RecordType> allRecords, java.lang.String... matchingKeyPaths)
adaptor
- key value adaptor to use to get the keyed values for the objectsallRecords
- all of the objects to filtermatchingKeyPaths
- the key paths corresponding to an object's keyed values to use for matchingpublic void setAllRecords(java.util.List<RecordType> allRecords)
public void setMatchingKeyPaths(java.lang.String... matchingKeyPaths)
public void indexRecords()
public void reIndexRecord(RecordType record)
public void filterRecordsTo(java.lang.String text, java.util.List<RecordType> matchingRecords)
text
- the text whose every word is matched against each recordmatchingRecords
- the container (first gets cleared) into which the matching records are placed preserving orderpublic java.util.List<RecordType> filterRecords(java.lang.String text)
text
- the text whose every word is matched against each record