|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object context.arch.discoverer.querySystem.AbstractQueryItem
Design pattern : Composite An AbstractQueryItem is the abstract element to create queries. A query may contain QueryItem or AbstractBooleanQueryItem. A QueryItem specifies the type of element searched, the value searched and a type of comparison. For example : type of element = type value = widget comparison = equal Another example : type of element = attribute value = username comparison = equal A AbstractBooleanQueryItem is just a node that contains 1 or 2 other AbstractQueryItem objects. A query is a tree. To process a query, the leaves of this tree returns an array that contains for all existing components in the data model, if each components suits the query or not (0 or 1). Example of query : QueryItem q1 = new QueryItem(new IdElement("PersonNamePresence2_rigatoni_1655")); // by default Equal() // IdElement implements IndexTableIF QueryItem q2 = new QueryItem(new PortElement("1520"),new GreaterEqual()); ANDQueryItem and = new ANDQueryItem(q1, q2); result = and.process(abstractDataModel); // abstractDataModel gets access to all IndexTableIF objects. There are 2 ways of processing a query : - when the query is processed for all existing objects in the AbstractDataModel - when the query is processed only for one object (to handle the notification) ------------------------------------------ | AbstractQueryItem | ------------------------------------------ | process(AbstractDataModel) : Object | | process(Object) : boolean | ------------------------------------------ /\ /\ | | -------------------------------------- | | QueryItem | | -------------------------------------- | |comparison : AbstractComparison | | |elToMatch : AbstractDescriptionElement| ------------------------------- -------------------------------------- | AbstractBooleanQueryItem | |process(AbstractDataModel) : Object | ------------------------------- |process(Object) : boolean | |son : AbstractQueryItem | -------------------------------------- |brother : AbstractQueryItem | ------------------------------- /\ | ___________________________________________|________________________________________ | | | -------------------------------------- -------------------------------------- -------------------------------------- | ANDQueryItem | | ORQueryItem | | NOTQueryItem | -------------------------------------- -------------------------------------- -------------------------------------- |process(AbstractDataModel) : Object | |process(AbstractDataModel) : Object | |process(AbstractDataModel) : Object | |process(Object) : boolean | |process(Object) : boolean | |process(Object) : boolean | ------------------------------------- ------------------------------------- --------------------------------------
context.arch.discoverer.dataModel
Field Summary | |
static java.lang.String |
ABSTRACT_QUERY_ITEM
|
Constructor Summary | |
AbstractQueryItem()
|
Method Summary | |
static java.lang.String |
arrayToString(java.lang.Object table)
Returns a string displaying a complex object |
static AbstractQueryItem |
fromDataObject(DataObject data)
Convert an DataObject into an AbstractQueryItem object |
abstract java.lang.Object |
process(AbstractDataModel dataModel)
This method allows to process an 2D array that contains in the first column the index of the component stored in the data model, and in the second column a integer value : 0 or 1 for false or true. |
abstract boolean |
process(java.lang.Object component)
Returns true if a component fits this query |
abstract DataObject |
toDataObject()
Returns a DataObject version of this object |
abstract java.lang.String |
toString()
Returns a printable version of this object |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String ABSTRACT_QUERY_ITEM
Constructor Detail |
public AbstractQueryItem()
Method Detail |
public abstract java.lang.Object process(AbstractDataModel dataModel)
dataModel
-
public abstract boolean process(java.lang.Object component)
component
-
public abstract java.lang.String toString()
public static java.lang.String arrayToString(java.lang.Object table)
table
-
public static AbstractQueryItem fromDataObject(DataObject data)
data
-
public abstract DataObject toDataObject()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |