All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ParkaClient.QueryResults

java.lang.Object
   |
   +----ParkaClient.QueryResults

public class QueryResults
extends Object
A batch of query results, when results are more than just 'true' or 'false'.


Constructor Index

 o QueryResults(boolean)
 o QueryResults(int, int)
Construct a new result set with n rows and m columns.

Method Index

 o getName(int)
Returns the name of the variable in the pos column (starting with 0).
 o getNameIndex(String)
Returns column index of named variable, or -1 if error-- eg, name not there.
 o getNames()
Return the names of all variables in the result.
 o getValue(int, int)
Return the value at a particular row and column number.
 o getValueMatrix()
Return the results as a matrix of strings.
 o getValues(int)
Return the set of variable bindings for a single answer (a row from the table).
 o numNames()
Returns the number of variables (columns) used in the result.
 o numResults()
Returns the number of results that will fit in the object.
 o removeDuplicates()
Remove duplicate answers(rows) from the results.
 o setName(int, String)
Set the name of a variable in a specific position.
 o setNames(String[])
Set the names of all variables.
 o setValueMatrix(String[])
Set the result based on the array of strings, where the rows have been linearized one after the other.
 o setValueMatrix(String[][])
Set the results based on the input matrix.
 o toString()
A debugging tool to print out the current results as a table.

Constructors

 o QueryResults
 public QueryResults(int n,
                     int m)
Construct a new result set with n rows and m columns.

 o QueryResults
 public QueryResults(boolean answer)

Methods

 o numResults
 public int numResults()
Returns the number of results that will fit in the object. This is odd, but the prior reasoning was: "Use the capacity, not size of the vector, since we need to be able to know how many answers will fit. Make sure that we keep the capacity trimmed to reflect the correct number of answers if any are removed..." May consider changing this. Will have to see how it is used in code.

 o numNames
 public int numNames()
Returns the number of variables (columns) used in the result.

 o getName
 public String getName(int pos)
Returns the name of the variable in the pos column (starting with 0).

 o getNames
 public String[] getNames()
Return the names of all variables in the result.

 o getValue
 public String getValue(int row,
                        int col)
Return the value at a particular row and column number.

 o getValues
 public String[] getValues(int pos)
Return the set of variable bindings for a single answer (a row from the table).

 o getValueMatrix
 public String[][] getValueMatrix()
Return the results as a matrix of strings.

 o getNameIndex
 public int getNameIndex(String varName)
Returns column index of named variable, or -1 if error-- eg, name not there.

 o setName
 public void setName(int pos,
                     String n)
Set the name of a variable in a specific position.

 o setNames
 public void setNames(String nArray[])
Set the names of all variables.

 o setValueMatrix
 public void setValueMatrix(String vMat[][])
Set the results based on the input matrix.

 o setValueMatrix
 public void setValueMatrix(String answerList[])
Set the result based on the array of strings, where the rows have been linearized one after the other. This input form is the way Parka returns answers.

 o removeDuplicates
 public boolean removeDuplicates()
Remove duplicate answers(rows) from the results.

 o toString
 public String toString()
A debugging tool to print out the current results as a table.

Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index