|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.info.LyTag
leon.info.LyInfo
leon.info.LyObjectInfo
leon.info.LyFilter
public final class LyFilter
The LyFilter class implements the description of a filter used to filter objects list.
A filter has a type which defines the type of filtering performed. Supported filter types are :
Type.AND (and filter), Type.OR (or filter).
Filters contain filter elements which is an interface implemented buy both LyFilerExpression and
by LyFilter. This means that a filter may contain simple filter expressions and sub-filters. This
allows to build complex filters.
See also tag
LyFilterExpression
,
LyFilterRelation
Nested Class Summary | |
---|---|
static class |
LyFilter.Type
Filter types. |
Nested classes/interfaces inherited from class leon.info.LyTag |
---|
LyTag.Model |
Field Summary | |
---|---|
static java.lang.String |
__VERSION
|
Fields inherited from class leon.info.LyObjectInfo |
---|
NULL, PART_ALL, PART_BIND, PART_DATA, PART_GUI, PART_LABEL |
Constructor Summary | |
---|---|
LyFilter()
Constructor of a default filter. |
|
LyFilter(LyFilter.Type type)
Constructor of a filter with a given filter type. |
|
LyFilter(LyFilter.Type type,
boolean not)
Constructor of a filter with a given filter type. |
|
LyFilter(java.lang.String id,
LyFilter template,
LyFilter.Type type)
Constructor of an identified filter. |
|
LyFilter(java.lang.String id,
LyFilter template,
LyFilter.Type type,
boolean not)
Constructor of an identified filter. |
Method Summary | |
---|---|
void |
addElement(LyFilterElement element)
Adds a new element to this filter. |
void |
addElement(LyFilterElement element,
int position)
Inserts a new element to this filter at the given position. |
LyFilter |
cloneFilter()
Clone this filter. |
LyFilter |
cloneFilter(LyDataSession session)
Clone this filter. |
boolean |
contains(LyFieldInfo fieldInfo)
Checks if an expression is found concerning the given field info. |
boolean |
contains(LyFilterElement element)
Checks if a filter element is found in this filter. |
java.lang.String |
dump()
Dumps current filter as a String. |
LyFilterElement |
getElement(int idx)
Get a filter element from this filter at the given index. |
java.util.Vector<LyFilterElement> |
getElements()
Returns the list of filter elements defined on this filter This is a COPY of the internal list, therefore this list may be freely manipulated by the application. |
LyInfoList<LyFieldInfo> |
getFieldInfos()
Gets list of fieldInfos that this filter refers to. |
LyInfoList<LyFieldInfo> |
getFieldInfos(boolean recurseFilterRelation)
Gets list of fieldInfos that this filter refers to. |
int |
getIndex(LyFilterElement element)
Gets index for the given element. |
LyFilter |
getInvertedFilter()
Clones and inverts this filter. |
LyFilter |
getPeerFilter()
Get an peer equivalent of the current filter |
int |
getSize()
Return the number of filter elements of this filter. |
LyFilter.Type |
getType()
Accessor to the type of the filter. |
void |
getValues(LyFieldInfo fieldInfo,
java.util.Vector<java.lang.Object> result)
Gets all filter values corresponding to the given field info. |
boolean |
hasLocalFields()
Indicate if this filter has a least one local fields. |
boolean |
isDynamic()
Checks if this filter is dynamic or not. |
boolean |
isExtended()
Indicates whether the filter is simple or extended. |
boolean |
isImpacted(LyValueSet values,
boolean recurse)
Checks if this filter if impacted by the changes contained in the value set. |
boolean |
isNot()
Indicates if the filter is a negation of the expression. |
LyObjectList |
match(java.util.Enumeration<?> objects,
LySimpleObjectList list)
Adds to given list objects of the given list that match this filter. |
int |
match(java.util.Enumeration<java.lang.Object> objects)
Counts objects of the given list that match this filter. |
boolean |
match(LyValueSet values)
Check if the specified values matches current filter. |
boolean |
match(java.lang.Object object)
Check if the specified object matches current filter. |
boolean |
matchClass(LyClassInfo classInfo)
Indicates if current filter may be applied to the specified class info. |
void |
removeElement(LyFilterElement element)
Removes an element from this filter. |
void |
setId(java.lang.String id)
Sets id of this info. |
void |
setType(LyFilter.Type type)
Sets filter type for this filter. |
void |
writeXml(java.io.PrintWriter pw)
Writes XML corresponding to this filter element. |
Methods inherited from class leon.info.LyObjectInfo |
---|
clone, getAlias, getData, getDataList, getDatas, getFilePrefix, getGroup, getInternalAlias, getInternalFilePrefix, getInternalName, getMarks, getName, getTemplate, getTip, getUserData, hasMark, hasMarks, hasTemplate, isTemplate, putData, putData, removeData, toName |
Methods inherited from class leon.info.LyInfo |
---|
getApplication, getFile, getId, getInclude, isIncluded, isInternal, isInternal, isLoaded, isLocked, load, setApplication, setFile, toString |
Methods inherited from class leon.info.LyTag |
---|
getCommentsEnd, getCommentsStart, getEnvironment, getModelType, getParent, getRootProject, hasAncestor, isExtern, setCommentsEnd, setCommentsStart, wasCloned |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface leon.info.LyFilterElement |
---|
getName |
Methods inherited from interface leon.parser.LyCommentInterface |
---|
getCommentsEnd, getCommentsStart, setCommentsEnd, setCommentsStart |
Field Detail |
---|
public static final java.lang.String __VERSION
Constructor Detail |
---|
public LyFilter(java.lang.String id, LyFilter template, LyFilter.Type type)
id
- Id of the filter.template
- Template model used to construct this filter.type
- Type of the filter. Supported filter types are : Type.AND (and filter),
Type.OR (or filter).public LyFilter(java.lang.String id, LyFilter template, LyFilter.Type type, boolean not)
id
- Id of the filter.template
- Template model used to construct this filter.type
- Type of the filter.not
- Indicates if the filter is a negation of the expression. Supported filter
types are : Type.AND (and filter), Type.OR (or filter).public LyFilter(LyFilter.Type type)
type
- Type of the filter. Supported filter types are : Type.AND (and filter), Type.OR
(or filter).public LyFilter(LyFilter.Type type, boolean not)
type
- Type of the filter.not
- Indicates if the filter is a negation of the expression. Supported filter types
are : Type.AND (and filter), Type.OR (or filter).public LyFilter()
Method Detail |
---|
public void setId(java.lang.String id)
public LyFilter cloneFilter()
public LyFilter cloneFilter(LyDataSession session)
public LyFilter getInvertedFilter()
public boolean match(java.lang.Object object)
match
in interface LyFilterElement
object
- Object to check.
LyFilterElement.match(java.lang.Object)
public boolean match(LyValueSet values)
match
in interface LyFilterElement
values
- Values to check.
LyFilterElement.match(java.lang.Object)
public boolean matchClass(LyClassInfo classInfo)
classInfo
- Class info to check.
public java.lang.String dump()
public void writeXml(java.io.PrintWriter pw)
writeXml
in interface LyFilterElement
pw
- PrintWriter on which the XML is written.public LyInfoList<LyFieldInfo> getFieldInfos()
public LyInfoList<LyFieldInfo> getFieldInfos(boolean recurseFilterRelation)
recurseFilterRelation
- indicates if search must be performed recursively on the
relation filters elements. If false, only relation field info
of the relation filters are added to the result list.
public void getValues(LyFieldInfo fieldInfo, java.util.Vector<java.lang.Object> result)
fieldInfo
- A field info.result
- result list.public LyObjectList match(java.util.Enumeration<?> objects, LySimpleObjectList list)
objects
- List to filter.list
- Result list (may be null).
public int match(java.util.Enumeration<java.lang.Object> objects)
objects
- List of objects to apply on filter.
public LyFilterElement getElement(int idx)
idx
- Index of the searched element.
public java.util.Vector<LyFilterElement> getElements()
public int getSize()
public LyFilter.Type getType()
public boolean isExtended()
public boolean contains(LyFieldInfo fieldInfo)
fieldInfo
- The fieldInfo.
public boolean contains(LyFilterElement element)
element
- The filter element.
public boolean isNot()
public boolean hasLocalFields()
public void setType(LyFilter.Type type)
type
- New type for filter.
java.lang.IllegalArgumentException
- If the given type is one of the supported types (Type.AND
or Type.OR).public void addElement(LyFilterElement element)
element
- Element to add to this filter. This element can be either a sub-filter or a
filter expression.public void addElement(LyFilterElement element, int position)
element
- Element to add to this filter. This element can be either a sub-filter or a
filter expression.position
- Position where the element is inserted.public void removeElement(LyFilterElement element)
element
- Element to remove from the filter.public int getIndex(LyFilterElement element)
public boolean isImpacted(LyValueSet values, boolean recurse)
public boolean isDynamic()
public LyFilter getPeerFilter()
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |