|
DODS 7.5 API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.enhydra.dods.cache.QueryCacheItemImpl
public class QueryCacheItemImpl
This class stores one query and its necessary data, for query array.
| Field Summary | |
|---|---|
protected boolean |
completeRes
True if all query results are cached, otherwise false. |
protected java.util.ArrayList |
conds
Array of conditions declared in WHERE part of the query (array of org.enhydra.dods.cache.Condition objects). |
protected org.enhydra.dods.cache.QueryCacheItemImpl.ListItem |
head
Head of object ID list in which are query results. |
protected boolean |
modifiedQuery
This attribute indicates whether there have been performed inserts, updates or deletes on results of this query. |
protected java.util.HashMap |
OIds
HashMap of data (and DataStruct) object IDs which are results of the query. |
protected java.lang.String |
originDatabase
Database of the query. |
protected java.lang.String |
queryId
Query id: String "query_database_name.String_presentation_of_query". |
protected int |
resultNum
Number of cached query results. |
protected org.enhydra.dods.cache.QueryCacheItemImpl.ListItem |
tail
Tail of object ID list in which are query results. |
protected int |
time
Time needed for query execution. |
| Constructor Summary | |
|---|---|
QueryCacheItemImpl(java.lang.String origDb)
Constructor (String). |
|
QueryCacheItemImpl(java.lang.String qId,
java.util.HashMap OIds,
int time,
java.util.ArrayList conditions,
java.lang.String origDb)
Constructor (String, LinkedHashSet, int, ArrayList, String). |
|
| Method Summary | |
|---|---|
void |
add(CoreDataStruct obj)
Adds DataStruct object obj to array DOs. |
void |
add(GenericDO obj)
Adds data object obj to array DOs. |
void |
addCond(Condition cond)
Adds condition to query. |
protected void |
addHandle(java.lang.String handle)
|
boolean |
checkConditions(CoreDataStruct obj)
Checks whether DataStruct object obj satisfies conditions of this query. |
boolean |
checkConditions(GenericDO obj)
Checks whether data object obj satisfies conditions of this query. |
void |
delete(CoreDataStruct obj)
Removes DataStruct object obj from array DOs, if present. |
void |
delete(GenericDO obj)
Removes data object obj from array DOs, if present. |
java.lang.String |
get_OriginDatabase()
Returns query database. |
java.util.ArrayList |
getConds()
Returns array of query conditions conds. |
java.util.Collection |
getOIds()
Returns OIds (Collection of object IDs which are results of the query). |
java.lang.String |
getOriginDatabase()
Deprecated. Use get_OriginDatabase() |
java.lang.String |
getQueryId()
Returns query id (String it the form: query_database_name.String_presentation_of_query). |
int |
getResultNum()
Returns number of cached query results. |
int |
getTime()
Returns time needed for query execution. |
boolean |
isCompleteResult()
Returns true if all query results are cached, otherwise false. |
boolean |
isModifiedQuery()
Returns true if there have been performed inserts, updates or deletes concerning results of this query, otherwise false. |
protected void |
removeHandle(java.lang.String handle)
|
void |
setCompleteResult(boolean newCompleteRes)
Sets new boolean value about the cached query results (true if all query results are cached, otherwise false). |
void |
setConds(java.util.ArrayList conds)
Sets array of query conditions. |
void |
setModifiedQuery(boolean mod)
Sets modifiedQuery attribute. |
void |
setQueryId(java.lang.String queryId)
Sets query id (String it the form: query_database_name.String_presentation_of_query). |
void |
setTime(int time)
Sets time needed for query execution. |
java.lang.String |
toString()
Shows content of this class. |
void |
update(CoreDataStruct obj)
Inserts DataStruct object obj (or updates it if already exists) in array DOs, if it satisfies this query. |
void |
update(GenericDO obj)
Inserts data object obj (or updates it if already exists) in array DOs, if it satisfies this query. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String queryId
protected java.util.HashMap OIds
protected int resultNum
protected boolean completeRes
protected org.enhydra.dods.cache.QueryCacheItemImpl.ListItem head
protected org.enhydra.dods.cache.QueryCacheItemImpl.ListItem tail
protected boolean modifiedQuery
protected int time
protected java.util.ArrayList conds
protected java.lang.String originDatabase
| Constructor Detail |
|---|
public QueryCacheItemImpl(java.lang.String origDb)
origDb - Query database.
public QueryCacheItemImpl(java.lang.String qId,
java.util.HashMap OIds,
int time,
java.util.ArrayList conditions,
java.lang.String origDb)
qId - Query id.OIds - Array of object IDs which are results of the Query.time - Query execution time.conditions - Conditions (WHERE part of the query).origDb - Query database.| Method Detail |
|---|
public java.lang.String getQueryId()
getQueryId in interface QueryCacheItempublic void setQueryId(java.lang.String queryId)
setQueryId in interface QueryCacheItemqueryId - Query id.public java.util.Collection getOIds()
getOIds in interface QueryCacheItempublic int getResultNum()
getResultNum in interface QueryCacheItempublic boolean isCompleteResult()
isCompleteResult in interface QueryCacheItempublic void setCompleteResult(boolean newCompleteRes)
setCompleteResult in interface QueryCacheItemnewCompleteRes - true if all query results are cached, otherwise
false.public boolean isModifiedQuery()
isModifiedQuery in interface QueryCacheItempublic void setModifiedQuery(boolean mod)
setModifiedQuery in interface QueryCacheItemmod - New value of attribute modifiedQuery.
concerning results of this query, otherwise false.public int getTime()
getTime in interface QueryCacheItempublic void setTime(int time)
setTime in interface QueryCacheItemtime - Time needed for query execution.public java.util.ArrayList getConds()
getConds in interface QueryCacheItempublic void setConds(java.util.ArrayList conds)
setConds in interface QueryCacheItemconds - Array of query conditions.public void addCond(Condition cond)
addCond in interface QueryCacheItemcond - Condition that will be added to query.public java.lang.String getOriginDatabase()
getOriginDatabase in interface QueryCacheItempublic java.lang.String get_OriginDatabase()
get_OriginDatabase in interface QueryCacheItempublic boolean checkConditions(GenericDO obj)
checkConditions in interface QueryCacheItemobj - Data object for which are checked conditions of this query.
public boolean checkConditions(CoreDataStruct obj)
checkConditions in interface QueryCacheItemobj - DataStruct object for which are checked conditions of this
query.
public void update(GenericDO obj)
update in interface QueryCacheItemobj - Data object which may be inserted (or updated) in array DOs.public void update(CoreDataStruct obj)
update in interface QueryCacheItemobj - DataStruct object which may be inserted (or updated) in array
DOs.public void delete(GenericDO obj)
delete in interface QueryCacheItemobj - Data object which will be removed from array DOs.public void delete(CoreDataStruct obj)
delete in interface QueryCacheItemobj - DataStruct object which will be removed from array DOs.public void add(GenericDO obj)
add in interface QueryCacheItemobj - Data object which will be added to array DOs.public void add(CoreDataStruct obj)
add in interface QueryCacheItemobj - DataStruct object which will be added to array DOs.public java.lang.String toString()
toString in class java.lang.Objectprotected void addHandle(java.lang.String handle)
protected void removeHandle(java.lang.String handle)
|
DODS 7.5 API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||