Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.modeshape.graph.query
Interface QueryResults.Columns

All Superinterfaces:
  Iterable<Column>, Serializable

All Known Implementing Classes:
  FullTextSearchResultColumns, QueryResultColumns

Enclosing interface:
  QueryResults

    @Immutable
    public static interface QueryResults.Columns

extends Serializable, Iterable<Column>

Definition of the columns that are available in the results, which outline the structure of the `tuples` in the results, and which can be used to access the individual values in each of the tuples.

Method Summary
`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.
`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).
`QueryResults.Columns` | `joinWith(QueryResults.Columns columns)` 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.

Methods inherited from interface java.lang.Iterable
`iterator`

Method Detail

### getColumns

    List<? extends Column> getColumns()

  Get the columns.

  Returns:
    the immutable list of columns, with size equal to `getColumnCount()`; never null

### getColumnNames

    List<String> getColumnNames()

  Get the names of the columns.

  Returns:
    the immutable list of column names, with size equal to `getColumnCount()`; never null

### getColumnTypes

    List<String> getColumnTypes()

  Get the `type name` for each column.

  Returns:
    the immutable list of type names, with size equal to `getColumnCount()`; never null

### getColumnCount

    int getColumnCount()

  Get the number of columns in each tuple.

  Returns:
    the number of columns; always positive

### getLocationCount

    int getLocationCount()

  Get the number of `Location` objects in each tuple.

  Returns:
    the number of Location objects; always positive

### getSelectorNames

    List<String> getSelectorNames()

  Get the names of the selectors that are associated with these results. These results contain a single `Location` object for each of the selectors.

  Returns:
    the immutable list of selector names, with size equal to `getLocationCount()`; never null

### getTupleSize

    int getTupleSize()

  Get the size of the tuple arrays.

  Returns:
    the length of each tuple array

### getTupleValueNames

    List<String> getTupleValueNames()

  Get the names of the all of the tuple values.

  Returns:
    the immutable list of names

### getLocationIndexForColumn

    int getLocationIndexForColumn(int columnIndex)

  Get the index of a tuple's correct Location object given the column index.

  Parameters:
    `columnIndex` - the column index
  Returns:
    the Location index that corresponds to the supplied column; never negative
  Throws:
    `IndexOutOfBoundsException` - if the column index is invalid

### getLocationIndexForColumn

    int getLocationIndexForColumn(String columnName)

  Get the index of a tuple's correct Location object given the column index.

  Parameters:
    `columnName` - the column name
  Returns:
    the Location index that corresponds to the supplied column; never negative
  Throws:
    `NoSuchElementException` - if the column name is invalid

### getLocationIndex

    int getLocationIndex(String selectorName)

  Get the index of a tuple's correct Location object given the name of the selector used in the query.

  Parameters:
    `selectorName` - the selector name
  Returns:
    the Location index that corresponds to the supplied column; never negative
  Throws:
    `NoSuchElementException` - if the selector name is invalid

### hasSelector

    boolean hasSelector(String selectorName)

  Determine if these results contain values from the selector with the supplied name.

  Parameters:
    `selectorName` - the selector name
  Returns:
    true if the results have values from the supplied selector, or false otherwise

### getPropertyNameForColumn

    String getPropertyNameForColumn(int columnIndex)

  Get the name of the property that corresponds to the supplied column in each tuple.

  Parameters:
    `columnIndex` - the column index
  Returns:
    the property name; never null
  Throws:
    `IndexOutOfBoundsException` - if the column index is invalid

### getPropertyNameForColumnName

    String getPropertyNameForColumnName(String columnName)

  Get the name of the property that corresponds to the named column in each tuple.

  Parameters:
    `columnName` - the column name
  Returns:
    the property name, or the supplied column name if there is no property for it

### getColumnIndexForName

    int getColumnIndexForName(String columnName)

  Get the index of the column given the column name.

  Parameters:
    `columnName` - the column name
  Returns:
    the column index
  Throws:
    `NoSuchElementException` - if the column name is invalid or doesn't match an existing column

### getSelectorNameForColumnName

    String getSelectorNameForColumnName(String columnName)

  Get the name of the selector that produced the column with the given name.

  Parameters:
    `columnName` - the column name
  Returns:
    the selector name
  Throws:
    `NoSuchElementException` - if the column name is invalid or doesn't match an existing column

### getColumnIndexForProperty

    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.

  Parameters:
    `selectorName` - the selector name
    `propertyName` - the name of the property
  Returns:
    the column index that corresponds to the supplied column; never negative
  Throws:
    `NoSuchElementException` - if the selector name or the property name are invalid

### getFullTextSearchScoreIndexFor

    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.

  Parameters:
    `selectorName` - the selector name
  Returns:
    the index that corresponds to the `Double` full-text search score, or -1 if there is no full-text search score for the named selector
  Throws:
    `NoSuchElementException` - if the selector name is invalid

### hasFullTextSearchScores

    boolean hasFullTextSearchScores()

  Determine whether these results include full-text search scores.

  Returns:
    true if the full-text search scores are included in the results, or false otherwise

### includes

    boolean includes(QueryResults.Columns other)

  Determine whether this mapping includes all of the columns (and locations) in the supplied mapping.

  Parameters:
    `other` - the other mapping; may not be null
  Returns:
    true if all of the other mapping's columns and locations are included in this mapping, or false otherwise

### isUnionCompatible

    boolean isUnionCompatible(QueryResults.Columns other)

  Determine whether this column and the other are union-compatible (that is, having the same columns).

  Parameters:
    `other` - the other mapping; may not be null
  Returns:
    true if this and the supplied columns definition are union-compatible, or false if they are not

### subSelect

    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. This is useful in a PROJECT operation, since that reduces the number of columns.

  Parameters:
    `columns` - the new columns, which must be a subset of the columns in this definition; may not be null
  Returns:
    the new columns definition; never null

### subSelect

    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. This is useful in a PROJECT operation, since that reduces the number of columns.

  Parameters:
    `columns` - the new columns, which must be a subset of the columns in this definition; may not be null
  Returns:
    the new columns definition; never null

### joinWith

    QueryResults.Columns joinWith(QueryResults.Columns columns)

  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. This is useful in a JOIN operation.

  Parameters:
    `columns` - the new columns, which must be a subset of the columns in this definition; may not be null
  Returns:
    the new columns definition; never null

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.