|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jgoodies.binding.beans.Model
com.jgoodies.bookfinder.domain.BookFilter
public final class BookFilter
Used to filter books in a list of books as done in the
SearchResultModel
.
The filtering is performed by the #accept(Book)
and #filter(Collection)
methods.
The FilterDialog presents and edits this class' properties.
SearchResultModel
,
FilterDialog
,
Serialized FormField Summary | |
---|---|
int |
limit
|
boolean |
limitEnabled
|
int |
price
|
boolean |
priceEnabled
|
static String |
PROPERTYNAME_LIMIT
|
static String |
PROPERTYNAME_LIMIT_ENABLED
|
static String |
PROPERTYNAME_PRICE
|
static String |
PROPERTYNAME_PRICE_ENABLED
|
static String |
PROPERTYNAME_YEAR
|
static String |
PROPERTYNAME_YEAR_ENABLED
|
int |
year
|
boolean |
yearEnabled
|
Constructor Summary | |
---|---|
BookFilter()
|
Method Summary | |
---|---|
boolean |
accept(Book details)
Tests and answers if the specified details should be displayed in the overview. |
List |
filter(Collection allElements)
Filters the given elements and returns a list of elements that are accepted by this filter. |
int |
getLimit()
Returns this filter's limit. |
int |
getPrice()
Returns this filter's price limit. |
int |
getYear()
Returns this filter's year limit. |
boolean |
isLimitEnabled()
Returns whether this filter takes the limit into account. |
boolean |
isPriceEnabled()
Returns whether the price filter is enabled. |
boolean |
isYearEnabled()
Returns whether the year filter is enabled. |
void |
restoreFrom(Preferences prefs)
Restores the persistent data from the specified Preferences . |
void |
setLimit(int limit)
Sets a new limit. |
void |
setLimitEnabled(boolean limitEnabled)
Enables or disables the limit filter. |
void |
setPrice(int price)
Sets a new price limit. |
void |
setPriceEnabled(boolean priceEnabled)
Enables or disables the price limit filter. |
void |
setYear(int year)
Sets a new year limit. |
void |
setYearEnabled(boolean yearEnabled)
Enables or disables the year filter. |
void |
storeIn(Preferences prefs)
Stores the persistent data in the specified Preferences . |
Methods inherited from class com.jgoodies.binding.beans.Model |
---|
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, equals, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, fireMultiplePropertiesChanged, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PROPERTYNAME_LIMIT
public static final String PROPERTYNAME_LIMIT_ENABLED
public static final String PROPERTYNAME_PRICE
public static final String PROPERTYNAME_PRICE_ENABLED
public static final String PROPERTYNAME_YEAR
public static final String PROPERTYNAME_YEAR_ENABLED
public boolean limitEnabled
public boolean priceEnabled
public boolean yearEnabled
public int limit
public int price
public int year
Constructor Detail |
---|
public BookFilter()
Method Detail |
---|
public boolean accept(Book details)
details
- the details to check
public List filter(Collection allElements)
allElements
- the element list to be filtered
public int getLimit()
public void setLimit(int limit)
limit
- The limit to set.public boolean isLimitEnabled()
public void setLimitEnabled(boolean limitEnabled)
limitEnabled
- true to enable the limit filterpublic int getPrice()
public void setPrice(int price)
price
- The price limit to set.public boolean isPriceEnabled()
public void setPriceEnabled(boolean priceEnabled)
priceEnabled
- true to filter pricespublic int getYear()
public void setYear(int year)
year
- The year limit to set.public boolean isYearEnabled()
public void setYearEnabled(boolean yearEnabled)
yearEnabled
- true to enable the year filterpublic void restoreFrom(Preferences prefs)
Preferences
.
public void storeIn(Preferences prefs)
Preferences
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |