Class AbstractDataFrame<Row,​Column,​V>

    • Constructor Detail

      • AbstractDataFrame

        protected AbstractDataFrame()
    • Method Detail

      • rows

        public java.lang.Iterable<Row> rows()
        Description copied from interface: DataFrame
        Returns the row keys.
        Specified by:
        rows in interface DataFrame<Row,​Column,​V>
        Returns:
        the row keys
      • columns

        public java.lang.Iterable<Column> columns()
        Description copied from interface: DataFrame
        Returns the column keys.
        Specified by:
        columns in interface DataFrame<Row,​Column,​V>
        Returns:
        the column keys
      • getRowAddress

        public int getRowAddress​(Row row)
        Description copied from interface: DataFrame
        Returns the absolute index for the specified row key. This is the inverse of DataFrame.getRowKey(int).
        Specified by:
        getRowAddress in interface DataFrame<Row,​Column,​V>
        Parameters:
        row - the row key
        Returns:
        the absolute index of the specified key.
      • getRowCount

        public int getRowCount()
        Description copied from interface: DataFrame
        Returns the number of rows contained by the this data frame.
        Specified by:
        getRowCount in interface DataFrame<Row,​Column,​V>
        Returns:
        the number of rows.
      • getColumnCount

        public int getColumnCount()
        Description copied from interface: DataFrame
        Returns the number of columns contained by this data frame.
        Specified by:
        getColumnCount in interface DataFrame<Row,​Column,​V>
        Returns:
        the number of columns.
      • getColumn

        public Series<Row,​V> getColumn​(Column column)
        Description copied from interface: DataFrame
        Returns a series of all the values of a given column.
        Specified by:
        getColumn in interface DataFrame<Row,​Column,​V>
        Parameters:
        column - the row key
        Returns:
        a Series object
      • orderRows

        public DataFrame<Row,​Column,​V> orderRows​(SortKey<Column>... sortKeys)
        Description copied from interface: DataFrame
        Returns a new data frame reordered using the values coming from the specified columns.
        Specified by:
        orderRows in interface DataFrame<Row,​Column,​V>
        Parameters:
        sortKeys - the columns to use for sorting
        Returns:
        the sorted data frame.
      • reindexColumns

        public <Column> DataFrame<Row,​Column,​V> reindexColumns​(Column... columns)
        Description copied from interface: DataFrame
        Returns a new data frame with column reindexed using the specified values.
        Specified by:
        reindexColumns in interface DataFrame<Row,​Column,​V>
        Parameters:
        columns - the values to use for the reindex columns
        Returns:
        the reindexed data frame.
      • append

        public DataFrame<Row,​Column,​V> append​(DataFrame<Row,​Column,​V> dataFrame)
        Description copied from interface: DataFrame
        Returns a new data frame with the rows of the specified data frame appended to the end of the this data frame.
        Specified by:
        append in interface DataFrame<Row,​Column,​V>
        Parameters:
        dataFrame - the data frame those rows are to be appended
        Returns:
        a combined data frame.
      • appendAndReindex

        public DataFrame<java.lang.Integer,​Column,​V> appendAndReindex​(DataFrame<Row,​Column,​V> dataFrame)
        Description copied from interface: DataFrame
        Returns a new data frame with the rows of the specified data frame appended to the end of the this data frame.
        Specified by:
        appendAndReindex in interface DataFrame<Row,​Column,​V>
        Parameters:
        dataFrame - the data frame those rows are to be appended
        Returns:
        a combined data frame.
      • filter

        public FilterDataFrame filter​(com.macrofocus.filter.MutableFilter<Row> filter)
        Description copied from interface: DataFrame
        Returns a new data frame those rows are filtered by the specified filter model.
        Specified by:
        filter in interface DataFrame<Row,​Column,​V>
        Parameters:
        filter - the filter model
        Returns:
        a filtered data frame
      • removeDuplicates

        public DataFrame<Row,​Column,​V> removeDuplicates​(Column... columns)
        Description copied from interface: DataFrame
        Returns a new data frame where duplicate entries for values of the specified column values.
        Specified by:
        removeDuplicates in interface DataFrame<Row,​Column,​V>
        Parameters:
        columns - the columns to use to check for duplicates
        Returns:
        a new data frame
      • getCube

        protected Cube getCube()
      • aggregate

        public AggregateDataFrame<Column> aggregate​(Aggregation... aggregations)
        Description copied from interface: DataFrame
        Returns a new data frame suitable for data aggregation. The additional methods provided to customize the aggregation criteria are provided by the AggregateDataFrame.
        Specified by:
        aggregate in interface DataFrame<Row,​Column,​V>
        Parameters:
        aggregations - the aggregation methods to use as columns
        Returns:
        an aggregated data frame.
      • getFirst

        public FirstAggregation getFirst​(Column column)
        Description copied from interface: DataFrame
        Returns the aggregation method that returns a constant value.
        Specified by:
        getFirst in interface DataFrame<Row,​Column,​V>
        Parameters:
        column - the constant value
        Returns:
        the aggregation method
      • getConstant

        public ConstantAggregation getConstant​(java.lang.Object value)
        Description copied from interface: DataFrame
        Returns the aggregation method that returns a constant value.
        Specified by:
        getConstant in interface DataFrame<Row,​Column,​V>
        Parameters:
        value - the constant value
        Returns:
        the aggregation method
      • getRandom

        public RandomAggregation getRandom​(double min,
                                           double max)
        Description copied from interface: DataFrame
        Returns the aggregation method that returns a random value.
        Specified by:
        getRandom in interface DataFrame<Row,​Column,​V>
        Returns:
        the aggregation method
      • getSum

        public SumAggregation getSum​(Column column)
        Description copied from interface: DataFrame
        Returns the aggregation method for computing the sum.
        Specified by:
        getSum in interface DataFrame<Row,​Column,​V>
        Parameters:
        column - the column key
        Returns:
        the aggregation method
      • getCount

        public CountAggregation getCount​(Column column)
        Description copied from interface: DataFrame
        Returns the aggregation method for counting the number of values.
        Specified by:
        getCount in interface DataFrame<Row,​Column,​V>
        Parameters:
        column - the column key
        Returns:
        the aggregation method
      • getMin

        public MinAggregation getMin​(Column column)
        Description copied from interface: DataFrame
        Returns the aggregation method for finding the minimum value.
        Specified by:
        getMin in interface DataFrame<Row,​Column,​V>
        Parameters:
        column - the column key
        Returns:
        the aggregation method
      • getMax

        public MaxAggregation getMax​(Column column)
        Description copied from interface: DataFrame
        Returns the aggregation method for finding the maximum value.
        Specified by:
        getMax in interface DataFrame<Row,​Column,​V>
        Parameters:
        column - the column key
        Returns:
        the aggregation method
      • getMean

        public MeanAggregation getMean​(Column column)
        Description copied from interface: DataFrame
        Returns the aggregation method for computing the mean value.
        Specified by:
        getMean in interface DataFrame<Row,​Column,​V>
        Parameters:
        column - the column key
        Returns:
        the aggregation method
      • getVarianceByPopulation

        public VarianceAggregation getVarianceByPopulation​(Column column,
                                                           Column population)
        Description copied from interface: DataFrame
        Returns the aggregation method for computing the variance by factoring in the specified population.
        Specified by:
        getVarianceByPopulation in interface DataFrame<Row,​Column,​V>
        Parameters:
        column - the column key
        population - the key of the column for the population
        Returns:
        the aggregation method
      • getStdDev

        public StdDevAggregation getStdDev​(Column column)
        Description copied from interface: DataFrame
        Returns the aggregation method for computing the standard deviation.
        Specified by:
        getStdDev in interface DataFrame<Row,​Column,​V>
        Parameters:
        column - the column key
        Returns:
        the aggregation method
      • getMedian

        public MedianAggregation getMedian​(Column column)
        Description copied from interface: DataFrame
        Returns the aggregation method for computing the median value.
        Specified by:
        getMedian in interface DataFrame<Row,​Column,​V>
        Parameters:
        column - the column key
        Returns:
        the aggregation method
      • getWeightedSum

        public Aggregation getWeightedSum​(Column weight,
                                          Column column)
        Description copied from interface: DataFrame
        Returns the aggregation method for computing the weighted sum.
        Specified by:
        getWeightedSum in interface DataFrame<Row,​Column,​V>
        column - the column key
        Returns:
        the aggregation method
      • getWeightedMean

        public Aggregation getWeightedMean​(Column weight,
                                           Column column)
        Description copied from interface: DataFrame
        Returns the aggregation method for computing the weigthed mean.
        Specified by:
        getWeightedMean in interface DataFrame<Row,​Column,​V>
        column - the column key
        Returns:
        the aggregation method
      • getCentroid

        public CentroidAggregation getCentroid​(Column column)
        Description copied from interface: DataFrame
        Returns the aggregation method for finding the centroid of geometries.
        Specified by:
        getCentroid in interface DataFrame<Row,​Column,​V>
        Parameters:
        column - the column key
        Returns:
        the aggregation method
      • getColumnName

        public java.lang.String getColumnName​(Column column)
        Description copied from interface: DataFrame
        Returns the name of the column. This is a convenience method for labeling purpose.
        Specified by:
        getColumnName in interface DataFrame<Row,​Column,​V>
        Parameters:
        column - the key of the column
        Returns:
        the name of the column
      • printSchema

        @GwtIncompatible
        public void printSchema()
        Description copied from interface: DataFrame
        Display the content of the data frame to the console.
        Specified by:
        printSchema in interface DataFrame<Row,​Column,​V>
      • print

        @GwtIncompatible
        public void print()
        Description copied from interface: DataFrame
        Display the content of the data frame to the console.
        Specified by:
        print in interface DataFrame<Row,​Column,​V>
      • print

        @GwtIncompatible
        public void print​(java.io.PrintStream out,
                          java.lang.String caption,
                          boolean html)
        Description copied from interface: DataFrame
        Display the content of the data frame to the specified output.
        Specified by:
        print in interface DataFrame<Row,​Column,​V>
        Parameters:
        out - the output
        caption - the title
        html - false for text output, true for HTML formatting
      • benchmark

        public void benchmark()
        Description copied from interface: DataFrame
        Perform some repetitive operation to estimate the performance of the data frame.
        Specified by:
        benchmark in interface DataFrame<Row,​Column,​V>
      • reindexRows

        public DataFrame<java.lang.Integer,​Column,​V> reindexRows()
        Description copied from interface: DataFrame
        Returns a new data frame reindexed using integers.
        Specified by:
        reindexRows in interface DataFrame<Row,​Column,​V>
        Returns:
        the reindexed data frame.
      • reindexRows

        public MutableDataFrame<V,​Column,​V> reindexRows​(Column column)
        Description copied from interface: DataFrame
        Returns a new data frame reindexed using the values coming from the specified column.
        Specified by:
        reindexRows in interface DataFrame<Row,​Column,​V>
        Parameters:
        column - the columns to use for the label values
        Returns:
        the reindexed data frame.
      • reindexRows

        public MutableDataFrame<V,​Column,​V> reindexRows​(boolean keepColumn,
                                                                    Column column)
        Description copied from interface: DataFrame
        Returns a new data frame reindexed using the values coming from the specified column.
        Specified by:
        reindexRows in interface DataFrame<Row,​Column,​V>
        column - the columns to use for the label values
        Returns:
        the reindexed data frame.
      • reindexRows

        public DataFrame<MultiKey,​Column,​V> reindexRows​(Column... columns)
        Description copied from interface: DataFrame
        Returns a new data frame reindexed using the values coming from the specified rows.
        Specified by:
        reindexRows in interface DataFrame<Row,​Column,​V>
        Parameters:
        columns - the columns to use for the label values
        Returns:
        the reindexed data frame.
      • reindexRows

        public DataFrame<MultiKey,​Column,​V> reindexRows​(boolean keepColumns,
                                                                    Column... columns)
        Description copied from interface: DataFrame
        Returns a new data frame reindexed using the values coming from the specified rows.
        Specified by:
        reindexRows in interface DataFrame<Row,​Column,​V>
        columns - the columns to use for the label values
        Returns:
        the reindexed data frame.
      • addWeakDataFrameListener

        public void addWeakDataFrameListener​(DataFrameListener<Row,​Column> listener)
        Description copied from interface: DataFrame
        Add a listener to the list that's notified each time a change to the data frame occurs. The listener will automatically be disposed of should no other object have a reference to it.
        Specified by:
        addWeakDataFrameListener in interface DataFrame<Row,​Column,​V>
        Parameters:
        listener - the DataFrameListener
      • removeDataFrameListeners

        public void removeDataFrameListeners()
        Description copied from interface: DataFrame
        Remove all listeners to the list that's notified each time a change to the data frame occurs.
        Specified by:
        removeDataFrameListeners in interface DataFrame<Row,​Column,​V>
      • notifyDataFrameChanged

        protected void notifyDataFrameChanged​(DataFrameEvent<Row,​Column> event)
        Fires an event event to listeners that have been registered to track changes to the data frame.
        Parameters:
        event - the event describing the changes