gov.nih.nci.cagrid.data.utilities
Class CQLResultsCreationUtil

java.lang.Object
  extended by gov.nih.nci.cagrid.data.utilities.CQLResultsCreationUtil

public class CQLResultsCreationUtil
extends java.lang.Object

CQLResultsCreationUtil Utility for creating CQL Query Results objects

Version:
$Id$
Author:
David W. Ervin

Constructor Summary
CQLResultsCreationUtil()
           
 
Method Summary
static CQLQueryResults createAttributeResults(java.util.List attribArrays, java.lang.String targetClassname, java.lang.String[] attribNames)
          Creates a CQL Query Results instance containing attribute results
static CQLQueryResults createCountResults(long count, java.lang.String targetClassname)
          Creates a CQL Query Results object containing a single count result
static CQLQueryResults createObjectResults(java.util.List objects, java.lang.String targetName, Mappings classToQname)
          Creates a CQL Query Results object containing object results
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CQLResultsCreationUtil

public CQLResultsCreationUtil()
Method Detail

createObjectResults

public static CQLQueryResults createObjectResults(java.util.List objects,
                                                  java.lang.String targetName,
                                                  Mappings classToQname)
                                           throws ResultsCreationException
Creates a CQL Query Results object containing object results

Parameters:
objects - The objects to serialize and place in the object results
targetName - The name of the targeted class which produced these results
classToQname - A Mapping from class name to QName
Returns:
A CQLQueryResults instance with its object results populated
Throws:
ResultsCreationException

createAttributeResults

public static CQLQueryResults createAttributeResults(java.util.List attribArrays,
                                                     java.lang.String targetClassname,
                                                     java.lang.String[] attribNames)
Creates a CQL Query Results instance containing attribute results

Parameters:
attribArrays - A List of String[], which are the values of the attributes. These values must correspond both in number and in order of the attribute names
targetClassname - The name of the class targeted
attribNames - The names of the attributes queried for
Returns:
A CQLQueryResults instance with its attribute results populated

createCountResults

public static CQLQueryResults createCountResults(long count,
                                                 java.lang.String targetClassname)
Creates a CQL Query Results object containing a single count result

Parameters:
count - The total count of all items
targetClassname - The classname of the query target
Returns:
A CQLQueryResults instance with count results populated