org.optimizationservices.oscommon.localinterface
Class OSQuery

java.lang.Object
  extended by org.optimizationservices.oscommon.localinterface.OSQuery

public class OSQuery
extends java.lang.Object

The OSQuery class is a local interface for storing Optimization Services query. Its design follows the Optimization Services query Language (OSqL). All the data structures in this class are standards specified in OSqL.

Since:
OS 1.0
Version:
1.0, 03/14/2005
Author:
Robert Fourer, Jun Ma, Kipp Martin

Field Summary
 StandardQuery standard
          standard holds the pre-built standard query keywords in the StandardQuery data structure.
 java.lang.String xQuery
          xQuery holds the query in the W3C XQuery format.
 
Constructor Summary
OSQuery()
          Default constructor.
 
Method Summary
 StandardQuery getStandardQuery()
          get the standard query data structure.
 java.lang.String getXQuery()
          Get the xQuery in a string.
static void main(java.lang.String[] args)
          main for test purposes.
 OSQuery readOSqL(java.lang.String osql, boolean isFile, boolean validate)
          read an OSqL instance and return and OSQuery object.
 boolean setStandardQuery(StandardQuery standardQuery)
          set the standard query.
 boolean setXQuery(java.lang.String xQuery)
          Set the XQuery.
 java.lang.String writeOSqL()
          write the OSQuery to an osql xml string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

standard

public StandardQuery standard
standard holds the pre-built standard query keywords in the StandardQuery data structure.


xQuery

public java.lang.String xQuery
xQuery holds the query in the W3C XQuery format.

Constructor Detail

OSQuery

public OSQuery()
Default constructor.

Method Detail

readOSqL

public OSQuery readOSqL(java.lang.String osql,
                        boolean isFile,
                        boolean validate)
                 throws java.lang.Exception
read an OSqL instance and return and OSQuery object.

Parameters:
osql - holds the optimization query in a string which format follows the Optimization Services query Language (OSqL) schema.
isFile - holds whether the osql string is a file name or a string that literally holds the osql contents.
validate - holds whether the reader should be validating against the schema or not.
Returns:
the OSQuery object constructed from the OSqL String.
Throws:
java.lang.Exception - if there are errors in reading the string or setting the OSQuery.

writeOSqL

public java.lang.String writeOSqL()
                           throws java.lang.Exception
write the OSQuery to an osql xml string.

Returns:
the osql xml string.
Throws:
java.lang.Exception - if there are errors in writing the osql string.

getStandardQuery

public StandardQuery getStandardQuery()
get the standard query data structure.

Returns:
standard query in the StandardQuery data structure; null if none.
See Also:
StandardQuery

setStandardQuery

public boolean setStandardQuery(StandardQuery standardQuery)
set the standard query.

Parameters:
standardQuery - holds the standard query in the StandardQuery data structure.
Returns:
whether the standard query is set successfully.
See Also:
StandardQuery

getXQuery

public java.lang.String getXQuery()
Get the xQuery in a string.

Returns:
the xQuery, null or empty string if none.

setXQuery

public boolean setXQuery(java.lang.String xQuery)
Set the XQuery.

Parameters:
xQuery - holds the XQuery in a string.
Returns:
whether the XQuery is set successfully or not.

main

public static void main(java.lang.String[] args)
main for test purposes.

Parameters:
argv - command line arguments.