org.ascape.query
Class Query

java.lang.Object
  extended by org.ascape.model.event.DefaultScapeListener
      extended by org.ascape.query.Query
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.EventListener, ScapeListener, HasName

public class Query
extends DefaultScapeListener

Only the form-based searches have the option of being dynamic. By default, they are static searches. The dynamicSearch flag will change that. Searches by user-input cannot be dynamic, due to the current implementation.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.ascape.model.event.DefaultScapeListener
listeningToScape, name, scape
 
Constructor Summary
Query(Scape collection, java.lang.String queryString)
          TODO: All of this.
Query(Scape collection, java.lang.String queryString, boolean dynamic)
           
 
Method Summary
 void execute()
           
 java.lang.String getName()
          Returns a name for the view as defined by set name.
 QTInput getQuery()
           
 java.lang.String getQueryString()
           
 java.util.List getResults()
           
 int getSearchFound()
           
 int getSearchPosition()
           
 int getSearchSize()
           
 boolean isDynamicSearch()
           
 boolean isEvaluating()
           
 void scapeIterated(ScapeEvent scapeEvent)
          Called immediatly after scape is iterated.
 void setDynamicSearch(boolean dynamicSearch)
           
 
Methods inherited from class org.ascape.model.event.DefaultScapeListener
clone, environmentQuiting, getScape, isGraphic, isLifeOfScape, isNotifyScapeAutomatically, notifyScapeUpdated, scapeAdded, scapeClosing, scapeDeserialized, scapeInitialized, scapeNotification, scapeRemoved, scapeSetup, scapeStarted, scapeStopped, setName, setNotifyScapeAutomatically, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Query

public Query(Scape collection,
             java.lang.String queryString)
      throws ParseException
TODO: All of this. Mostly, make searching the same, regardless of simple or complex quotes, especially re: the spacing between parameters. String based. See comments below for more details, but essentially, a search with a boolean operator (complex) must be enclosed by parens. Searches without one (simple) can be, but do not have to be. Complex Query: A series of strings using parens and boolean operators. For now, unlike the simple queries, there are no spaces allowed in the simple query portions. For example, ((age>15) AND (color=blue)). Complex queries do not yet allow for parameters enclosed in quotes. Simple Query: assume each token is a param_operator_value broken up by BooleanOperators example 1: age>15 example 2: color=blue.. Zero or One space is allowed. New Note: When a search parameter is enclosed in quotes ("Holland Queen"), you must leave a space between the parameters: value2 = "Holland Queen". take each token and parse it into a search string

Parameters:
collection - the collection to be searched
queryString -
Throws:
ParseException

Query

public Query(Scape collection,
             java.lang.String queryString,
             boolean dynamic)
      throws ParseException
Throws:
ParseException
Method Detail

execute

public void execute()

scapeIterated

public void scapeIterated(ScapeEvent scapeEvent)
Description copied from class: DefaultScapeListener
Called immediatly after scape is iterated.

Specified by:
scapeIterated in interface ScapeListener
Overrides:
scapeIterated in class DefaultScapeListener
Parameters:
scapeEvent - the scape event

getResults

public java.util.List getResults()

getName

public java.lang.String getName()
Description copied from class: DefaultScapeListener
Returns a name for the view as defined by set name.

Specified by:
getName in interface HasName
Overrides:
getName in class DefaultScapeListener
Returns:
the name

isDynamicSearch

public boolean isDynamicSearch()

setDynamicSearch

public void setDynamicSearch(boolean dynamicSearch)

getSearchSize

public int getSearchSize()

getSearchPosition

public int getSearchPosition()

getSearchFound

public int getSearchFound()

isEvaluating

public boolean isEvaluating()

getQueryString

public java.lang.String getQueryString()

getQuery

public QTInput getQuery()


Copyright © 1998-2008 The Brookings Institution, NuTech Solutions, Metascape, LLC All Rights Reserved.