|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.monad.homerun.base.DataObject
com.monad.homerun.filter.Filter
public class Filter
A Filter is an ordered list of Screens, minimum one. When a filter is applied, the result is a collection of objects that satisfy all the constituent screens. One primary use is in the definition of group objects. Filters are domain-specific, and have syntax and semantics that closely resemble Rules, in that each Screen is like a Condition, and can be alternated or combined with other Screens, validated, traced, etc. They also may contain a list of derived value types, which are the application of a function to the object collection with respect to an invariant component (model, property, etc). Filters are maintained by the FilterMaker app.
Constructor Summary | |
---|---|
Filter()
|
|
Filter(java.lang.String filterName,
java.lang.String domain)
|
|
Filter(java.lang.String setName,
java.lang.String domain,
Filter filterSet)
|
Method Summary | |
---|---|
void |
addScreen(Screen screen)
Adds a screen to the filter. |
void |
addValue(FilterValue value)
Adds a value to the filter. |
java.lang.String[] |
getIComps(Screener screener)
Returns a list of 'invariant' components of given type. |
int |
getNumScreens()
Returns the number of screens in the filter |
int |
getNumValues()
Returns the number of values in the filter |
Screen |
getScreen(int index)
Return the screen at the specified index |
FilterValue |
getValue(int index)
|
FilterValue |
getValue(java.lang.String name)
Returns the FilterValue matching the specified name |
FilterValue[] |
getValues()
|
boolean |
isRuntime(Screener screener)
Does filter contain any runtime screens? |
boolean |
pass(Screener screener,
java.lang.String objectName,
java.util.List<java.lang.String> callStack,
FilterTrace trace)
Tests the object against the filter (with optional tracing) |
void |
removeScreen(int index)
Removes a screen from the filter at the position indicated by index. |
void |
removeValue(FilterValue value)
Removes a value from the filter. |
void |
replaceScreen(int index,
Screen screen)
Replaces a screen in the filter at the position indicated by index. |
boolean |
validate(Screener screener,
java.util.List<java.lang.String> callStack,
FilterTrace trace)
Verifies that: (a) filter is syntactically valid, (b) all the terms of the filter are valid references, and (c) filter does not circularly invoke itself |
Methods inherited from class com.monad.homerun.base.DataObject |
---|
getCategory, getModificationTime, getName, getNote, setCategory, setModificationTime, setName, setNote |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Filter()
public Filter(java.lang.String filterName, java.lang.String domain)
public Filter(java.lang.String setName, java.lang.String domain, Filter filterSet)
Method Detail |
---|
public void addScreen(Screen screen)
screen
- the screen to addpublic void removeScreen(int index)
index
- the index of the screen to removepublic void replaceScreen(int index, Screen screen)
index
- the index of the screen to removescreen
- the screen to addpublic void addValue(FilterValue value)
value
- the filter value to addpublic void removeValue(FilterValue value)
value
- the filter value to removepublic boolean validate(Screener screener, java.util.List<java.lang.String> callStack, FilterTrace trace)
screener
- the Screener to usecallStack
- the stack of filters calledtrace
- optional trace object
public boolean pass(Screener screener, java.lang.String objectName, java.util.List<java.lang.String> callStack, FilterTrace trace)
screener
- the Screening agentobjectName
- the object being screenedtrace
- the optional trace object
public boolean isRuntime(Screener screener)
screener
- the Screener object
public java.lang.String[] getIComps(Screener screener)
public int getNumScreens()
public Screen getScreen(int index)
index
- the index of the screen
public int getNumValues()
public FilterValue getValue(int index)
public FilterValue[] getValues()
public FilterValue getValue(java.lang.String name)
name
- the name of the value
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |