Class DefaultIItemResultSet

    • Field Detail

      • attributes

        private final java.util.List<IAttribute<?>> attributes
      • aggregators

        private final java.util.List<IAggregator<?,​?>> aggregators
      • info

        private final java.util.Map<java.lang.String,​ColumnInfo> info
      • data

        private final java.util.ArrayList<java.lang.Object[]> data
      • cursor

        private int cursor
    • Method Detail

      • getFirstNonNull

        private static java.lang.Object getFirstNonNull​(IItemCollection items,
                                                        IAttribute<?> attribute)
        Returns the first encountered non-null attribute value, or null if no non-null value could be found.
        Parameters:
        items - the items to search.
        attribute - the attribute to look for.
        Returns:
        the first value found.
      • newRow

        private java.lang.Object[] newRow()
      • initializeMetadata

        private void initializeMetadata()
      • getQuery

        public IItemQuery getQuery()
        Description copied from interface: IItemResultSet
        Returns the query used to create the result set.
        Specified by:
        getQuery in interface IItemResultSet
        Returns:
        the query used to create the result set.
      • getValue

        public java.lang.Object getValue​(int column)
                                  throws ItemResultSetException
        Description copied from interface: IItemResultSet
        Returns the value for the specified column, at the current row.
        Specified by:
        getValue in interface IItemResultSet
        Parameters:
        column - the column for which to return the value.
        Returns:
        value for the specified column, at the current row.
        Throws:
        ItemResultSetException - if there was a problem reading the value, such as the cursor not being at a value, the column not existing etc.
      • getNoOfColumns

        private int getNoOfColumns()
      • getColumnMetadata

        public java.util.Map<java.lang.String,​ColumnInfo> getColumnMetadata()
        Description copied from interface: IItemResultSet
        Returns the column metadata for the result set. Useful for finding out what column an attribute or an aggregator is mapping to.
        Specified by:
        getColumnMetadata in interface IItemResultSet
        Returns:
        the column metadata.
      • next

        public boolean next()
        Description copied from interface: IItemResultSet
        Advances the cursor to the next row in the result set. Returns true if there is still more rows, and false if the end has been reached.
        Specified by:
        next in interface IItemResultSet
        Returns:
        true if there is still more rows, and false if the end has been reached.