@Immutable public class QueryResultColumns extends Object implements QueryResults.Columns
Modifier and Type | Class and Description |
---|---|
protected static class |
QueryResultColumns.ColumnInfo |
protected static class |
QueryResultColumns.WrappedReformatter |
Modifier and Type | Field and Description |
---|---|
protected static String |
DEFAULT_SELECTOR_NAME |
protected static QueryResultColumns |
EMPTY |
protected static List<Column> |
NO_COLUMNS |
protected static List<String> |
NO_TYPES |
Modifier | Constructor and Description |
---|---|
protected |
QueryResultColumns(boolean includeFullTextSearchScores,
List<? extends Column> columns,
List<String> columnTypes)
Create a new definition for the query results given the supplied columns.
|
|
QueryResultColumns(List<? extends Column> columns,
List<String> columnTypes,
boolean includeFullTextSearchScores)
Create a new definition for the query results given the supplied columns.
|
Modifier and Type | Method and Description |
---|---|
protected Integer |
columnIndexForName(String columnName) |
protected static String |
columnNameFor(Column column,
List<String> columnNames,
Set<Column> columnsWithDuplicateNames,
Collection<String> selectorNames) |
static QueryResultColumns |
empty()
Get an empty results column definition.
|
boolean |
equals(Object obj) |
protected static Set<Column> |
findColumnsWithSameNames(List<Column> columns) |
int |
getColumnCount()
Get the number of columns in each tuple.
|
int |
getColumnIndexForName(String columnName)
Get the index of the column given the column name.
|
int |
getColumnIndexForProperty(String selectorName,
String propertyName)
Get the index of the column given the name of the selector and the property name from where the column should be
obtained.
|
List<String> |
getColumnNames()
Get the names of the columns.
|
List<? extends Column> |
getColumns()
Get the columns.
|
String |
getColumnTypeForProperty(String selectorName,
String propertyName)
Get the type of the column given the name of the selector and the property name from where the column should be
obtained.
|
List<String> |
getColumnTypes()
Get the type name for each column.
|
int |
getFullTextSearchScoreIndexFor(String selectorName)
Get the index of the tuple value containing the full-text search score for the node taken from the named selector.
|
int |
getLocationCount()
Get the number of
QueryResults.Location objects in each tuple. |
int |
getLocationIndex(String selectorName)
Get the index of a tuple's correct Location object given the name of the selector used in the query.
|
int |
getLocationIndexForColumn(int columnIndex)
Get the index of a tuple's correct Location object given the column index.
|
int |
getLocationIndexForColumn(String columnName)
Get the index of a tuple's correct Location object given the column index.
|
String |
getPropertyNameForColumn(int columnIndex)
Get the name of the property that corresponds to the supplied column in each tuple.
|
String |
getPropertyNameForColumnName(String columnName)
Get the name of the property that corresponds to the named column in each tuple.
|
String |
getSelectorNameForColumnName(String columnName)
Get the name of the selector that produced the column with the given name.
|
List<String> |
getSelectorNames()
Get the names of the selectors that are associated with these results.
|
QueryResults.TupleReformatter |
getTupleReformatter()
Get the reducer that converts a tuple of the form described by the wrapped columns format to this columns format.
|
int |
getTupleSize()
Get the size of the tuple arrays.
|
List<String> |
getTupleValueNames()
Get the names of the all of the tuple values.
|
boolean |
hasFullTextSearchScores()
Determine whether these results include full-text search scores.
|
int |
hashCode() |
boolean |
hasSelector(String selectorName)
Determine if these results contain values from the selector with the supplied name.
|
static boolean |
includeFullTextScores(Constraint constraint) |
static boolean |
includeFullTextScores(Iterable<Constraint> constraints) |
boolean |
includes(QueryResults.Columns other)
Determine whether this mapping includes all of the columns (and locations) in the supplied mapping.
|
boolean |
isUnionCompatible(QueryResults.Columns other)
Determine whether this column and the other are union-compatible (that is, having the same columns).
|
Iterator<Column> |
iterator() |
QueryResults.Columns |
joinWith(QueryResults.Columns rightColumns)
Obtain a new definition for the query results that is a combination of the these columns and the supplied columns,
where the columns from this object appear first, followed by columns from the supplied set.
|
QueryResults.Columns |
subSelect(Column... columns)
Obtain a new definition for the query results that can be used to reference the same tuples that use this columns
definition, but that defines a subset of the columns in this definition.
|
QueryResults.Columns |
subSelect(List<Column> columns)
Obtain a new definition for the query results that can be used to reference the same tuples that use this columns
definition, but that defines a subset of the columns in this definition.
|
String |
toString() |
protected static final QueryResultColumns EMPTY
protected static final String DEFAULT_SELECTOR_NAME
public QueryResultColumns(List<? extends Column> columns, List<String> columnTypes, boolean includeFullTextSearchScores)
columns
- the columns that define the results; should never be modified directlycolumnTypes
- the names of the types for each column in columns
includeFullTextSearchScores
- true if room should be made in the tuples for the full-text search scores for each
QueryResults.Location
, or false otherwiseprotected QueryResultColumns(boolean includeFullTextSearchScores, List<? extends Column> columns, List<String> columnTypes)
includeFullTextSearchScores
- true if room should be made in the tuples for the full-text search scores for each
QueryResults.Location
, or false otherwisecolumns
- the columns that define the results; should never be modified directlycolumnTypes
- the names of the types for each column in columns
public static QueryResultColumns empty()
public static boolean includeFullTextScores(Iterable<Constraint> constraints)
public static boolean includeFullTextScores(Constraint constraint)
public QueryResults.Columns subSelect(List<Column> columns)
QueryResults.Columns
subSelect
in interface QueryResults.Columns
columns
- the new columns, which must be a subset of the columns in this definition; may not be nullpublic QueryResults.Columns subSelect(Column... columns)
QueryResults.Columns
subSelect
in interface QueryResults.Columns
columns
- the new columns, which must be a subset of the columns in this definition; may not be nullpublic QueryResults.TupleReformatter getTupleReformatter()
QueryResults.Columns
getTupleReformatter
in interface QueryResults.Columns
public QueryResults.Columns joinWith(QueryResults.Columns rightColumns)
QueryResults.Columns
joinWith
in interface QueryResults.Columns
rightColumns
- the new columns, which must be a subset of the columns in this definition; may not be nullpublic List<? extends Column> getColumns()
QueryResults.Columns
getColumns
in interface QueryResults.Columns
QueryResults.Columns.getColumnCount()
; never nullpublic List<String> getColumnNames()
QueryResults.Columns
getColumnNames
in interface QueryResults.Columns
QueryResults.Columns.getColumnCount()
; never nullpublic List<String> getColumnTypes()
QueryResults.Columns
getColumnTypes
in interface QueryResults.Columns
QueryResults.Columns.getColumnCount()
; never nullpublic int getColumnCount()
QueryResults.Columns
getColumnCount
in interface QueryResults.Columns
public int getLocationCount()
QueryResults.Columns
QueryResults.Location
objects in each tuple.getLocationCount
in interface QueryResults.Columns
public List<String> getSelectorNames()
QueryResults.Columns
QueryResults.Location
object for each of the selectors.getSelectorNames
in interface QueryResults.Columns
QueryResults.Columns.getLocationCount()
; never nullpublic int getTupleSize()
QueryResults.Columns
getTupleSize
in interface QueryResults.Columns
public List<String> getTupleValueNames()
QueryResults.Columns
getTupleValueNames
in interface QueryResults.Columns
public int getLocationIndexForColumn(int columnIndex)
QueryResults.Columns
getLocationIndexForColumn
in interface QueryResults.Columns
columnIndex
- the column indexpublic int getLocationIndexForColumn(String columnName)
QueryResults.Columns
getLocationIndexForColumn
in interface QueryResults.Columns
columnName
- the column namepublic int getLocationIndex(String selectorName)
QueryResults.Columns
getLocationIndex
in interface QueryResults.Columns
selectorName
- the selector namepublic boolean hasSelector(String selectorName)
QueryResults.Columns
hasSelector
in interface QueryResults.Columns
selectorName
- the selector namepublic String getPropertyNameForColumn(int columnIndex)
QueryResults.Columns
getPropertyNameForColumn
in interface QueryResults.Columns
columnIndex
- the column indexpublic String getPropertyNameForColumnName(String columnName)
QueryResults.Columns
getPropertyNameForColumnName
in interface QueryResults.Columns
columnName
- the column namepublic int getColumnIndexForName(String columnName)
QueryResults.Columns
getColumnIndexForName
in interface QueryResults.Columns
columnName
- the column namepublic String getSelectorNameForColumnName(String columnName)
QueryResults.Columns
getSelectorNameForColumnName
in interface QueryResults.Columns
columnName
- the column namepublic int getColumnIndexForProperty(String selectorName, String propertyName)
QueryResults.Columns
getColumnIndexForProperty
in interface QueryResults.Columns
selectorName
- the selector namepropertyName
- the name of the propertypublic String getColumnTypeForProperty(String selectorName, String propertyName)
QueryResults.Columns
getColumnTypeForProperty
in interface QueryResults.Columns
selectorName
- the selector namepropertyName
- the name of the propertypublic int getFullTextSearchScoreIndexFor(String selectorName)
QueryResults.Columns
getFullTextSearchScoreIndexFor
in interface QueryResults.Columns
selectorName
- the selector nameDouble
full-text search score, or -1 if there is no full-text search
score for the named selectorpublic boolean hasFullTextSearchScores()
QueryResults.Columns
hasFullTextSearchScores
in interface QueryResults.Columns
public boolean includes(QueryResults.Columns other)
QueryResults.Columns
includes
in interface QueryResults.Columns
other
- the other mapping; may not be nullpublic boolean isUnionCompatible(QueryResults.Columns other)
QueryResults.Columns
isUnionCompatible
in interface QueryResults.Columns
other
- the other mapping; may not be nullprotected static String columnNameFor(Column column, List<String> columnNames, Set<Column> columnsWithDuplicateNames, Collection<String> selectorNames)
protected static Set<Column> findColumnsWithSameNames(List<Column> columns)
Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.