ewe.database
Class EntryComparer
java.lang.Object
ewe.database.EntryComparer
- All Implemented Interfaces:
- Comparer, DatabaseEntryComparer
- Direct Known Subclasses:
- StandardEntryComparer
- public abstract class EntryComparer
- extends Object
- implements DatabaseEntryComparer
|
Field Summary |
protected boolean |
compareAsDatabaseEntries
If this is set true, then when compareEntries() is called the two objects
will be of type DatabaseEntries. |
protected Database |
db
|
db
protected Database db
compareAsDatabaseEntries
protected boolean compareAsDatabaseEntries
- If this is set true, then when compareEntries() is called the two objects
will be of type DatabaseEntries. If it is false then the entries will be converted
to the Database's data object. This is false by default.
EntryComparer
protected EntryComparer()
EntryComparer
public EntryComparer(Database db)
throws IllegalArgumentException
compare
public final int compare(Object one,
Object two)
- Description copied from interface:
Comparer
- This should compare the two objects and return:
0 = the objects are equal.
greater than 0 = one is greater than two.
less than 0 = two is greater than one.
- Specified by:
compare in interface Comparer
compareEntries
protected abstract int compareEntries(Object one,
Object two)
- Override this to compare to entries. If you are doing a findFirst() or findLast() or
a search(), then the first argument will always be the searchData that you provided.
setDatabase
public void setDatabase(Database db)
- Specified by:
setDatabase in interface DatabaseEntryComparer