|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.graph.query.process.QueryResultColumns
@Immutable public class QueryResultColumns
Defines the columns associated with the results of a query. This definition allows the values to be accessed
Field Summary | |
---|---|
protected static String |
DEFAULT_SELECTOR_NAME
|
protected static QueryResultColumns |
EMPTY
|
protected static List<Column> |
NO_COLUMNS
|
protected static List<String> |
NO_TYPES
|
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
protected Integer |
columnIndexForName(String columnName)
|
protected static String |
columnNameFor(Column column,
List<String> columnNames,
Set<Column> columnsWithDuplicateNames)
|
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. |
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 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. |
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. |
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()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final List<Column> NO_COLUMNS
protected static final List<String> NO_TYPES
protected static final QueryResultColumns EMPTY
protected static final String DEFAULT_SELECTOR_NAME
Constructor Detail |
---|
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
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
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
Method Detail |
---|
public static QueryResultColumns empty()
public static boolean includeFullTextScores(Iterable<Constraint> constraints)
public static boolean includeFullTextScores(Constraint constraint)
public QueryResults.Columns subSelect(List<Column> columns)
subSelect
in interface QueryResults.Columns
columns
- the new columns, which must be a subset of the columns in this definition; may not be null
QueryResults.Columns.subSelect(java.util.List)
public QueryResults.Columns subSelect(Column... columns)
subSelect
in interface QueryResults.Columns
columns
- the new columns, which must be a subset of the columns in this definition; may not be null
QueryResults.Columns.subSelect(org.modeshape.graph.query.model.Column[])
public QueryResults.Columns joinWith(QueryResults.Columns rightColumns)
joinWith
in interface QueryResults.Columns
rightColumns
- the new columns, which must be a subset of the columns in this definition; may not be null
QueryResults.Columns.joinWith(org.modeshape.graph.query.QueryResults.Columns)
public List<? extends Column> getColumns()
getColumns
in interface QueryResults.Columns
QueryResults.Columns.getColumnCount()
; never nullQueryResults.Columns.getColumns()
public Iterator<Column> iterator()
iterator
in interface Iterable<Column>
Iterable.iterator()
public List<String> getColumnNames()
getColumnNames
in interface QueryResults.Columns
QueryResults.Columns.getColumnCount()
; never nullQueryResults.Columns.getColumnNames()
public List<String> getColumnTypes()
type name
for each column.
getColumnTypes
in interface QueryResults.Columns
QueryResults.Columns.getColumnCount()
; never nullQueryResults.Columns.getColumnTypes()
public int getColumnCount()
getColumnCount
in interface QueryResults.Columns
QueryResults.Columns.getColumnCount()
public int getLocationCount()
Location
objects in each tuple.
getLocationCount
in interface QueryResults.Columns
QueryResults.Columns.getLocationCount()
public List<String> getSelectorNames()
Location
object for each of the selectors.
getSelectorNames
in interface QueryResults.Columns
QueryResults.Columns.getLocationCount()
; never nullQueryResults.Columns.getSelectorNames()
public int getTupleSize()
getTupleSize
in interface QueryResults.Columns
QueryResults.Columns.getTupleSize()
public List<String> getTupleValueNames()
getTupleValueNames
in interface QueryResults.Columns
QueryResults.Columns.getTupleValueNames()
public int getLocationIndexForColumn(int columnIndex)
getLocationIndexForColumn
in interface QueryResults.Columns
columnIndex
- the column index
QueryResults.Columns.getLocationIndexForColumn(int)
public int getLocationIndexForColumn(String columnName)
getLocationIndexForColumn
in interface QueryResults.Columns
columnName
- the column name
QueryResults.Columns.getLocationIndexForColumn(java.lang.String)
public int getLocationIndex(String selectorName)
getLocationIndex
in interface QueryResults.Columns
selectorName
- the selector name
QueryResults.Columns.getLocationIndex(java.lang.String)
public boolean hasSelector(String selectorName)
hasSelector
in interface QueryResults.Columns
selectorName
- the selector name
QueryResults.Columns.hasSelector(java.lang.String)
public String getPropertyNameForColumn(int columnIndex)
getPropertyNameForColumn
in interface QueryResults.Columns
columnIndex
- the column index
QueryResults.Columns.getPropertyNameForColumn(int)
public String getPropertyNameForColumnName(String columnName)
QueryResults.Columns
getPropertyNameForColumnName
in interface QueryResults.Columns
columnName
- the column name
public int getColumnIndexForName(String columnName)
getColumnIndexForName
in interface QueryResults.Columns
columnName
- the column name
QueryResults.Columns.getColumnIndexForName(java.lang.String)
protected Integer columnIndexForName(String columnName)
public String getSelectorNameForColumnName(String columnName)
getSelectorNameForColumnName
in interface QueryResults.Columns
columnName
- the column name
QueryResults.Columns.getSelectorNameForColumnName(java.lang.String)
public int getColumnIndexForProperty(String selectorName, String propertyName)
getColumnIndexForProperty
in interface QueryResults.Columns
selectorName
- the selector namepropertyName
- the name of the property
QueryResults.Columns.getColumnIndexForProperty(java.lang.String, java.lang.String)
public int getFullTextSearchScoreIndexFor(String selectorName)
getFullTextSearchScoreIndexFor
in interface QueryResults.Columns
selectorName
- the selector name
Double
full-text search score, or -1 if there is no full-text search
score for the named selectorQueryResults.Columns.getFullTextSearchScoreIndexFor(java.lang.String)
public boolean hasFullTextSearchScores()
hasFullTextSearchScores
in interface QueryResults.Columns
QueryResults.Columns.hasFullTextSearchScores()
public boolean includes(QueryResults.Columns other)
includes
in interface QueryResults.Columns
other
- the other mapping; may not be null
QueryResults.Columns.includes(org.modeshape.graph.query.QueryResults.Columns)
public boolean isUnionCompatible(QueryResults.Columns other)
isUnionCompatible
in interface QueryResults.Columns
other
- the other mapping; may not be null
QueryResults.Columns.isUnionCompatible(org.modeshape.graph.query.QueryResults.Columns)
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
protected static String columnNameFor(Column column, List<String> columnNames, Set<Column> columnsWithDuplicateNames)
protected static Set<Column> findColumnsWithSameNames(List<Column> columns)
public String toString()
toString
in class Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |