Package org.swrlapi.sqwrl
Interface SQWRLResultGenerator
-
- All Known Subinterfaces:
SQWRLResultManager
public interface SQWRLResultGenerator
Interface to configure a SQWRL query result and then add data to it. See theSQWRLResultManager
class for detailed comments.- See Also:
SQWRLResultManager
,SQWRLQuery
,SQWRLQueryEngine
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addAggregateColumn(@NonNull java.lang.String columnName, @NonNull java.lang.String aggregateFunctionName)
void
addCell(@NonNull SQWRLResultValue value)
void
addColumn(@NonNull java.lang.String columnName)
void
addColumnDisplayName(@NonNull java.lang.String columnName)
void
addColumns(@NonNull java.util.List<@NonNull java.lang.String> columnNames)
void
addRow(@NonNull java.util.List<@NonNull SQWRLResultValue> resultValues)
Add a row to the result.void
closeRow()
void
configured()
Indicate that the result is configuredint
getCurrentNumberOfColumns()
boolean
isConfigured()
boolean
isOrdered()
boolean
isOrderedAscending()
boolean
isPrepared()
boolean
isRowOpen()
void
openRow()
Open a row for incremental cell additionvoid
prepared()
Indicate that the result is preparedvoid
setFirst(int n)
Exclude all but the first n result rows.void
setIsDistinct()
Indicate that duplicate columns should be removedvoid
setLast()
Exclude all but the last result rowvoid
setLast(int n)
Exclude all but the last n result rowsvoid
setLimit(int limit)
void
setNotFirst(int n)
Exclude the first n result rowsvoid
setNotLast(int n)
Exclude the last n result rowsvoid
setNotNth(int nth)
Exclude the nth result rowvoid
setNotNthLastSlice(int nth, int sliceSize)
void
setNotNthSlice(int nth, int sliceSize)
void
setNth(int nth)
void
setNthLastSlice(int nth, int sliceSize)
void
setNthSlice(int nth, int sliceSize)
void
setOrderByColumn(int orderedColumnIndex, boolean ascending)
-
-
-
Method Detail
-
addColumns
void addColumns(@NonNull java.util.List<@NonNull java.lang.String> columnNames) throws SQWRLException
- Parameters:
columnNames
- A list of column names- Throws:
SQWRLException
- If an error occurs during column addition
-
addColumn
void addColumn(@NonNull java.lang.String columnName) throws SQWRLException
- Parameters:
columnName
- A column name- Throws:
SQWRLException
- If an error occurs during column addition
-
addAggregateColumn
void addAggregateColumn(@NonNull java.lang.String columnName, @NonNull java.lang.String aggregateFunctionName) throws SQWRLException
- Parameters:
columnName
- A column nameaggregateFunctionName
- The name of an aggregate function- Throws:
SQWRLException
- If an error occurs during column addition
-
setOrderByColumn
void setOrderByColumn(int orderedColumnIndex, boolean ascending) throws SQWRLException
- Parameters:
orderedColumnIndex
- The 0-based index of an order columnascending
- Order ascending or descending- Throws:
SQWRLException
- If an error occurs
-
isOrdered
boolean isOrdered()
- Returns:
- True of the result is ordered
-
isOrderedAscending
boolean isOrderedAscending()
- Returns:
- True if the result is ordered ascending
-
setIsDistinct
void setIsDistinct()
Indicate that duplicate columns should be removed
-
addColumnDisplayName
void addColumnDisplayName(@NonNull java.lang.String columnName) throws SQWRLException
- Parameters:
columnName
- The name of a column- Throws:
SQWRLException
- If an error occurs during display name addition
-
getCurrentNumberOfColumns
int getCurrentNumberOfColumns() throws SQWRLException
- Returns:
- The current number of result columns
- Throws:
SQWRLException
- If the result is already configured
-
isConfigured
boolean isConfigured()
- Returns:
- True if the result is configured
-
configured
void configured() throws SQWRLException
Indicate that the result is configured- Throws:
SQWRLException
- If the result is already configured
-
addRow
void addRow(@NonNull java.util.List<@NonNull SQWRLResultValue> resultValues) throws SQWRLException
Add a row to the result.- Parameters:
resultValues
- A list of SQWRL result values- Throws:
SQWRLException
- If an error occurs during row addition
-
openRow
void openRow() throws SQWRLException
Open a row for incremental cell addition- Throws:
SQWRLException
- If an error occurs opening the row
-
addCell
void addCell(@NonNull SQWRLResultValue value) throws SQWRLException
- Parameters:
value
- A cell value- Throws:
SQWRLException
- If an error occurs adding the cell
-
closeRow
void closeRow() throws SQWRLException
- Throws:
SQWRLException
- If an error occurs during row closing
-
isRowOpen
boolean isRowOpen()
- Returns:
- True if a row is open
-
isPrepared
boolean isPrepared()
- Returns:
- True if the result is prepared
-
prepared
void prepared() throws SQWRLException
Indicate that the result is prepared- Throws:
SQWRLException
- If the result is not yet configured or is already prepared
-
setLimit
void setLimit(int limit)
-
setNth
void setNth(int nth)
- Parameters:
nth
- 1-based index
-
setNotNth
void setNotNth(int nth)
Exclude the nth result row- Parameters:
nth
- 1-based index
-
setFirst
void setFirst(int n)
Exclude all but the first n result rows.- Parameters:
n
- Number of rows to retain
-
setLast
void setLast()
Exclude all but the last result row
-
setLast
void setLast(int n)
Exclude all but the last n result rows- Parameters:
n
- Number of rows to retain
-
setNotFirst
void setNotFirst(int n)
Exclude the first n result rows- Parameters:
n
- Number of rows to exclude
-
setNotLast
void setNotLast(int n)
Exclude the last n result rows- Parameters:
n
- Number of rows to exclude
-
setNthSlice
void setNthSlice(int nth, int sliceSize)
- Parameters:
nth
- 1-based indexsliceSize
- size of the slice
-
setNotNthSlice
void setNotNthSlice(int nth, int sliceSize)
- Parameters:
nth
- 1-based indexsliceSize
- size of the slice
-
setNthLastSlice
void setNthLastSlice(int nth, int sliceSize)
- Parameters:
nth
- 1-based indexsliceSize
- size of the slice
-
setNotNthLastSlice
void setNotNthLastSlice(int nth, int sliceSize)
- Parameters:
nth
- 1-based indexsliceSize
- size of the slice
-
-