Style Intelligence v12.0

inetsoft.uql.schema
Class QueryVariable

java.lang.Object
  extended by inetsoft.uql.schema.XVariable
      extended by inetsoft.uql.schema.QueryVariable
All Implemented Interfaces:
inetsoft.util.XMLSerializable, Serializable, Cloneable

public class QueryVariable
extends XVariable

A QueryVariable is a variable that derives its value from the result of a query. The result is normally a summarization of query results.

See Also:
Serialized Form

Field Summary
static String AVG
          Calculate the average of data.
static String COUNT
          Calculate the number of occurrence.
static String DISTINCT_COUNT
          Calculate the unique number of occurrence.
static String MAX
          Calculate the maximum of data.
static String MIN
          Calculate the minimum of data.
static String SUM
          Calculate the sum of data.
 
Constructor Summary
QueryVariable()
           
 
Method Summary
 Object clone()
          Returns a clone of this object.
 Object evaluate(VariableTable vars)
          Evaulate the XVariable.
 XNode execute(VariableTable vars)
          Execute the query defined in this variable, and apply any path selection if defined.
 String getAggregate()
          Get the aggregate function name.
 XQuery getLocalQuery()
          Get the XQuery only for local query.
 XQueryRepository getLocalQueryRepository()
          Get the local query repository.
 XNodePath getNodePath()
          Get the tree selection path.
 String getQuery()
          Get the query name.
 boolean isLocalQuery()
          Get local query option.
 void parseXML(Element root)
          Parse the XML element that contains information on this variable.
 void setAggregate(String aggregate)
          Set the aggregate function to apply to the selection result.
 void setLocalQuery(boolean local)
          Set local query option.
 void setLocalQueryRepository(XQueryRepository repository)
          Set the local query repository.
 void setNodePath(XNodePath path)
          Set the node path to select a node from the query result tree to use as the value of the variable.
 void setQuery(String query)
          Set the query to extract result from.
 void writeXML(PrintWriter writer)
          Write the variable XML representation.
 
Methods inherited from class inetsoft.uql.schema.XVariable
getName, getSource, parse, parseAttributes, setName, setSource, writeAttributes
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUM

public static final String SUM
Calculate the sum of data.

See Also:
Constant Field Values

AVG

public static final String AVG
Calculate the average of data.

See Also:
Constant Field Values

MIN

public static final String MIN
Calculate the minimum of data.

See Also:
Constant Field Values

MAX

public static final String MAX
Calculate the maximum of data.

See Also:
Constant Field Values

COUNT

public static final String COUNT
Calculate the number of occurrence.

See Also:
Constant Field Values

DISTINCT_COUNT

public static final String DISTINCT_COUNT
Calculate the unique number of occurrence.

See Also:
Constant Field Values
Constructor Detail

QueryVariable

public QueryVariable()
Method Detail

setQuery

public void setQuery(String query)
Set the query to extract result from.

Parameters:
query - query name.

getQuery

public String getQuery()
Get the query name.


getLocalQuery

public XQuery getLocalQuery()
Get the XQuery only for local query.


getLocalQueryRepository

public XQueryRepository getLocalQueryRepository()
Get the local query repository.


setLocalQueryRepository

public void setLocalQueryRepository(XQueryRepository repository)
Set the local query repository.


setNodePath

public void setNodePath(XNodePath path)
Set the node path to select a node from the query result tree to use as the value of the variable.

Parameters:
path - tree selection path.

getNodePath

public XNodePath getNodePath()
Get the tree selection path.


setAggregate

public void setAggregate(String aggregate)
Set the aggregate function to apply to the selection result.

Parameters:
aggregate - function name, one of SUM, AVG, MIN, MAX, and COUNT.

getAggregate

public String getAggregate()
Get the aggregate function name.


setLocalQuery

public void setLocalQuery(boolean local)
Set local query option.


isLocalQuery

public boolean isLocalQuery()
Get local query option.


evaluate

public Object evaluate(VariableTable vars)
Evaulate the XVariable. Will execute and return XNode value.

Specified by:
evaluate in class XVariable

execute

public XNode execute(VariableTable vars)
              throws Exception
Execute the query defined in this variable, and apply any path selection if defined.

Returns:
query result.
Throws:
Exception

parseXML

public void parseXML(Element root)
              throws Exception
Parse the XML element that contains information on this variable.

Throws:
Exception

writeXML

public void writeXML(PrintWriter writer)
Write the variable XML representation.


clone

public Object clone()
Returns a clone of this object.

Overrides:
clone in class XVariable

Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.