net.ontopia.topicmaps.query.impl.rdbms
Class BooleanQueryResult

java.lang.Object
  extended by net.ontopia.topicmaps.query.impl.rdbms.BooleanQueryResult
All Implemented Interfaces:
QueryResultIF

public class BooleanQueryResult
extends java.lang.Object
implements QueryResultIF

INTERNAL: Query result representating queries have no variables and evaluate to either true or false.


Constructor Summary
BooleanQueryResult(java.lang.String[] colnames, boolean result)
           
BooleanQueryResult(java.lang.String[] colnames, java.lang.Object[] values, boolean result)
           
 
Method Summary
 void close()
          PUBLIC: Closes the query result, which allows it to free its resources.
 java.lang.String getColumnName(int ix)
          PUBLIC: Returns the name of the given column.
 java.lang.String[] getColumnNames()
          PUBLIC: Returns the names of the columns.
 int getIndex(java.lang.String colname)
          PUBLIC: Returns the index of the named column.
 java.lang.Object getValue(int ix)
          PUBLIC: Returns the value in the given column in the current match.
 java.lang.Object getValue(java.lang.String colname)
          PUBLIC: Returns the value in the given column in the current match.
 java.lang.Object[] getValues()
          PUBLIC: Returns the current match as an array of values.
 java.lang.Object[] getValues(java.lang.Object[] values)
          PUBLIC: Reads the values of the current match into the specified array.
 int getWidth()
          PUBLIC: Returns the number of columns in the result.
 boolean next()
          PUBLIC: Steps to the next match, returning true if a valid match was found, and false if there are no more matches.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BooleanQueryResult

public BooleanQueryResult(java.lang.String[] colnames,
                          boolean result)

BooleanQueryResult

public BooleanQueryResult(java.lang.String[] colnames,
                          java.lang.Object[] values,
                          boolean result)
Method Detail

next

public boolean next()
Description copied from interface: QueryResultIF
PUBLIC: Steps to the next match, returning true if a valid match was found, and false if there are no more matches. Must be called before values can be returned.

Specified by:
next in interface QueryResultIF

getValue

public java.lang.Object getValue(int ix)
Description copied from interface: QueryResultIF
PUBLIC: Returns the value in the given column in the current match. The column index is zero-based. Requires next() to have been called first.

Specified by:
getValue in interface QueryResultIF

getValue

public java.lang.Object getValue(java.lang.String colname)
Description copied from interface: QueryResultIF
PUBLIC: Returns the value in the given column in the current match. Requires next() to have been called first.

Specified by:
getValue in interface QueryResultIF

getWidth

public int getWidth()
Description copied from interface: QueryResultIF
PUBLIC: Returns the number of columns in the result.

Specified by:
getWidth in interface QueryResultIF

getIndex

public int getIndex(java.lang.String colname)
Description copied from interface: QueryResultIF
PUBLIC: Returns the index of the named column. Returns -1 if the column does not exist. The column index is zero-based.

Specified by:
getIndex in interface QueryResultIF

getColumnNames

public java.lang.String[] getColumnNames()
Description copied from interface: QueryResultIF
PUBLIC: Returns the names of the columns.

Specified by:
getColumnNames in interface QueryResultIF

getColumnName

public java.lang.String getColumnName(int ix)
Description copied from interface: QueryResultIF
PUBLIC: Returns the name of the given column. The column index is zero-based.

Specified by:
getColumnName in interface QueryResultIF

getValues

public java.lang.Object[] getValues()
Description copied from interface: QueryResultIF
PUBLIC: Returns the current match as an array of values. Note that the returned array should not be modified as it may lead to undefined results. Requires next() to have been called first.

Specified by:
getValues in interface QueryResultIF

getValues

public java.lang.Object[] getValues(java.lang.Object[] values)
Description copied from interface: QueryResultIF
PUBLIC: Reads the values of the current match into the specified array. Requires next() to have been called first.

Specified by:
getValues in interface QueryResultIF

close

public void close()
Description copied from interface: QueryResultIF
PUBLIC: Closes the query result, which allows it to free its resources.

Specified by:
close in interface QueryResultIF


Copyright © 2000-2012 Ontopia.