edu.cmu.aura.service
Class QueryResult

java.lang.Object
  |
  +--edu.cmu.aura.service.QueryResult

public class QueryResult
extends java.lang.Object

QueryResult represents the result of executing a query on a primitive service. The QueryResult contains the time, according to the service, at which the query finished executing, a flag indicating whether the service was able to provide a complete result, and a list of attribute sets obtained by executing the query. An attribute set is a list of selected attributes from a single entity or relation that matched a query (i.e. it is a "row" in the result).


Constructor Summary
QueryResult()
          Create a QueryResult.
 
Method Summary
 void addAttribSet(java.util.ArrayList attribSet)
          Add an attribute set to this query.
 void addSubResult(QueryResult subResult)
           
 java.util.ArrayList getAttributeSet(int index)
          Get a specified attribute set.
 int getNumAttribSets()
          Get the number of attribute sets in this result.
 TimeInstant getTime()
          Get the time at which this query finished executing.
 boolean isComplete()
          Returns whether or not this QueryResult represents a complete result.
 void setComplete(boolean complete)
          Sets whether or not this result is complete.
 void setTime(long time)
          Set the time at which this query finished executing.
 void setTime(TimeInstant time)
          Set the time at which this query finished executing.
 java.lang.String toString()
          Convert this QueryResult to a String.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QueryResult

public QueryResult()
Create a QueryResult.
Method Detail

getTime

public TimeInstant getTime()
Get the time at which this query finished executing.
Returns:
the time at which this query finished executing.

setTime

public void setTime(TimeInstant time)
Set the time at which this query finished executing.
Parameters:
time - the time at which this query finished executing.

setTime

public void setTime(long time)
Set the time at which this query finished executing.
Parameters:
time - the time at which this query finished executing.

setComplete

public void setComplete(boolean complete)
Sets whether or not this result is complete.
Parameters:
complete - whether or not this result is complete.

isComplete

public boolean isComplete()
Returns whether or not this QueryResult represents a complete result. Complete results indicate that the service was able to completely answer the query. Incomplete results indicate that the query constraints were not entirely met.
Returns:
whether or not this result is complete.

addAttribSet

public void addAttribSet(java.util.ArrayList attribSet)
Add an attribute set to this query.
Parameters:
attribSet - the attribute set to add.

getAttributeSet

public java.util.ArrayList getAttributeSet(int index)
Get a specified attribute set.
Parameters:
index - the index of the attribute set to get.
Returns:
the specified attribute set.

getNumAttribSets

public int getNumAttribSets()
Get the number of attribute sets in this result.
Returns:
the number of attribute sets in this result.

addSubResult

public void addSubResult(QueryResult subResult)

toString

public java.lang.String toString()
Convert this QueryResult to a String.
Overrides:
toString in class java.lang.Object
Returns:
a String representation of this QueryResult.