public class EntrySelector extends Object
Modifier and Type | Field and Description |
---|---|
int[] |
criteria |
Database |
db |
DatabaseEntry |
de |
boolean |
forceAFilterSearch |
boolean |
hasWildCards |
Constructor and Description |
---|
EntrySelector(Database db,
Object searchData,
int[] criteria,
boolean hasWildCards) |
EntrySelector(Database db,
Object primarySearchFields,
int sortID,
boolean hasWildCards) |
EntrySelector(Database db,
Object searchData,
int sortID,
int numberOfCriteria,
boolean hasWildCards) |
EntrySelector(FoundEntries fe,
Object primarySearchFields,
boolean hasWildCards) |
EntrySelector(FoundEntries fe,
Object searchData,
int numberOfCriteria,
boolean hasWildCards) |
Modifier and Type | Method and Description |
---|---|
boolean |
canSearch(FoundEntries fe)
Return if the specified FoundEntries is sorted by a search criteria that is compatible with
this EntrySelector, such that a binary-chop search is possible using this EntrySelector
on the specified FoundEntries.
|
boolean |
canSearch(int sortID)
Return if the specified sort ID for the EntrySelector's Database is compatible with
this EntrySelector, such that a binary-chop search is possible using this EntrySelector
on the database.
|
boolean |
canSearch(int[] sortCriteria)
Return if the specified sort criteria is compatible with
this EntrySelector, such that a binary-chop search is possible using this EntrySelector
on the database.
|
int |
compare(Object dataOrEntry) |
int |
decode(Database db,
byte[] source,
int offset,
DataProcessor decryptor)
Decode the EntrySelector for use with the specified Database.
|
protected int |
doCompare(DatabaseEntry myData,
DatabaseEntry other) |
ByteArray |
encode(ByteArray destination,
DataProcessor encryptor)
Encode and append the EntrySelector to a ByteArray.
|
int[] |
getCriteria() |
Comparer |
toComparer() |
ObjectFinder |
toObjectFinder() |
public DatabaseEntry de
public Database db
public int[] criteria
public boolean hasWildCards
public boolean forceAFilterSearch
public EntrySelector(Database db, Object primarySearchFields, int sortID, boolean hasWildCards)
public EntrySelector(FoundEntries fe, Object primarySearchFields, boolean hasWildCards)
public EntrySelector(FoundEntries fe, Object searchData, int numberOfCriteria, boolean hasWildCards)
public EntrySelector(Database db, Object searchData, int[] criteria, boolean hasWildCards)
public EntrySelector(Database db, Object searchData, int sortID, int numberOfCriteria, boolean hasWildCards) throws IllegalArgumentException
IllegalArgumentException
public int[] getCriteria()
public ByteArray encode(ByteArray destination, DataProcessor encryptor) throws IOException
destination
- the destination ByteArray. If this is null a new one will be created.encryptor
- an optional encryptor for the field search data.IOException
- if there was an error encrypting the data.public int decode(Database db, byte[] source, int offset, DataProcessor decryptor) throws IOException
db
- The Database this comparer will be used with.source
- The encoded bytes.offset
- The offset in the array of the bytes.length
- The number of bytes.decryptor
- An optional decryptor to decrypt the data.IOException
- if there is an error decyrpting the data.public boolean canSearch(FoundEntries fe)
public boolean canSearch(int[] sortCriteria)
public boolean canSearch(int sortID) throws IllegalArgumentException
IllegalArgumentException
protected int doCompare(DatabaseEntry myData, DatabaseEntry other)
public int compare(Object dataOrEntry) throws IllegalArgumentException
IllegalArgumentException
public ObjectFinder toObjectFinder()
public Comparer toComparer()