|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hd.d.pg2k.webSvr.exhibit.Expr
public abstract class Expr
Abstract base for an expression (for a FilterBean). Expressions must be Serializable so that they can be persisted. They must not attempt to cache any reference, direct or indirect, to a DataSourceBean.
Expression objects must be immutable and their accept()/sort() methods must be idempotent.
Expressions may be nested like this:
new SortExpr(new FilterExpr(null, new BuiltInFilters.filtAll(null)),
new BuiltInFilters.sortByName(BuiltInFilters.sortByName.SMART))
Operations such as filtering and sorting may be carried out concurrently internally, so filters and sorts should be thread-safe and should preferably admit concurrency if possible.
FIXME: this and all derived classes and expressions must support equals() and hashCode() where possible.
| Field Summary | |
|---|---|
private static long |
serialVersionUID
Unique Serialisation class ID generated by http://random.hd.org/. |
private Expr |
upstream
The upstream expression pipeline. |
| Constructor Summary | |
|---|---|
protected |
Expr(Expr _upstream)
Construct us with the upstream expression. |
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object obj)
Equality depends on the upstream expressions being equal (or both null). |
Name.ExhibitFull[] |
eval(AllExhibitProperties aep,
Name.ExhibitFull[] in)
Evaluate this expression. |
int |
hashCode()
Hash depends on upstream object, or is zero if none. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final Expr upstream
private static final long serialVersionUID
| Constructor Detail |
|---|
protected Expr(Expr _upstream)
| Method Detail |
|---|
public Name.ExhibitFull[] eval(AllExhibitProperties aep,
Name.ExhibitFull[] in)
We return a set of names, possibly empty.
The result array contains no duplicates nor nulls (providing the input is similarly well-behaved) and is never null itself.
Designed to be overridden and have super() called to collect upstream results... By itself returns all the exhibits untouched, ie is a null filter/sorter, the identity expression.
The head of the expression chain takes a copy of the inputs and returns them; other items just pass the data up untouched.
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object
|
DHD Multimedia Gallery V1.57.21 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||