Gephi Toolkit Javadoc

org.gephi.datalab.impl
Class AttributeColumnsMergeStrategiesControllerImpl

java.lang.Object
  extended by org.gephi.datalab.impl.AttributeColumnsMergeStrategiesControllerImpl
All Implemented Interfaces:
AttributeColumnsMergeStrategiesController

public class AttributeColumnsMergeStrategiesControllerImpl
extends java.lang.Object
implements AttributeColumnsMergeStrategiesController

Implementation of the AttributeColumnsMergeStrategiesController interface declared in the Data Laboratory API.

Author:
Eduardo Ramos
See Also:
AttributeColumnsMergeStrategiesController

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.gephi.datalab.api.AttributeColumnsMergeStrategiesController
AttributeColumnsMergeStrategiesController.BooleanOperations
 
Constructor Summary
AttributeColumnsMergeStrategiesControllerImpl()
           
 
Method Summary
 AttributeColumn averageNumberMerge(AttributeTable table, AttributeColumn[] columnsToMerge, java.lang.String newColumnTitle)
          Merges any combination of number or number list columns, calculating the average of all not null values and puts the result of each row in a new column of BIGDECIMAL AttributeType.
 AttributeColumn booleanLogicOperationsMerge(AttributeTable table, AttributeColumn[] columnsToMerge, AttributeColumnsMergeStrategiesController.BooleanOperations[] booleanOperations, java.lang.String newColumnTitle)
          Strategy to apply only to all boolean columns.
 AttributeColumn firstQuartileNumberMerge(AttributeTable table, AttributeColumn[] columnsToMerge, java.lang.String newColumnTitle)
          Merges any combination of number or number list columns, calculating the first quartile (Q1) of all not null values and puts the result of each row in a new column of BIGDECIMAL AttributeType.
 AttributeColumn interQuartileRangeNumberMerge(AttributeTable table, AttributeColumn[] columnsToMerge, java.lang.String newColumnTitle)
          Merges any combination of number or number list columns, calculating the interquartile range (IQR) of all not null values and puts the result of each row in a new column of BIGDECIMAL AttributeType.
 AttributeColumn joinWithSeparatorMerge(AttributeTable table, AttributeColumn[] columnsToMerge, AttributeType newColumnType, java.lang.String newColumnTitle, java.lang.String separator)
          Joins various columns of any type into a new column using the given separator string (or null).
 AttributeColumn maxValueNumbersMerge(AttributeTable table, AttributeColumn[] columnsToMerge, java.lang.String newColumnTitle)
          Merges any combination of number or number list columns, calculating the maximum value of all not null values and puts the result of each row in a new column of BIGDECIMAL AttributeType.
 AttributeColumn medianNumberMerge(AttributeTable table, AttributeColumn[] columnsToMerge, java.lang.String newColumnTitle)
          Merges any combination of number or number list columns, calculating the median of all not null values and puts the result of each row in a new column of BIGDECIMAL AttributeType.
 AttributeColumn mergeDateColumnsToTimeInterval(AttributeTable table, AttributeColumn startColumn, AttributeColumn endColumn, java.text.SimpleDateFormat dateFormat, java.lang.String defaultStartDate, java.lang.String defaultEndDate)
          Merge 1 or 2 columns creating a time interval for each row.
 AttributeColumn mergeNumericColumnsToTimeInterval(AttributeTable table, AttributeColumn startColumn, AttributeColumn endColumn, double defaultStart, double defaultEnd)
          Merge 1 or 2 columns creating a time interval for each row.
 AttributeColumn minValueNumbersMerge(AttributeTable table, AttributeColumn[] columnsToMerge, java.lang.String newColumnTitle)
          Merges any combination of number or number list columns, calculating the minimum value of all not null values and puts the result of each row in a new column of BIGDECIMAL AttributeType.
 AttributeColumn sumNumbersMerge(AttributeTable table, AttributeColumn[] columnsToMerge, java.lang.String newColumnTitle)
          Merges any combination of number or number list columns, calculating the sum of all not null values and puts the result of each row in a new column of BIGDECIMAL AttributeType.
 AttributeColumn thirdQuartileNumberMerge(AttributeTable table, AttributeColumn[] columnsToMerge, java.lang.String newColumnTitle)
          Merges any combination of number or number list columns, calculating the third quartile (Q3) of all not null values and puts the result of each row in a new column of BIGDECIMAL AttributeType.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeColumnsMergeStrategiesControllerImpl

public AttributeColumnsMergeStrategiesControllerImpl()
Method Detail

joinWithSeparatorMerge

public AttributeColumn joinWithSeparatorMerge(AttributeTable table,
                                              AttributeColumn[] columnsToMerge,
                                              AttributeType newColumnType,
                                              java.lang.String newColumnTitle,
                                              java.lang.String separator)
Description copied from interface: AttributeColumnsMergeStrategiesController

Joins various columns of any type into a new column using the given separator string (or null).

If the specified column type is null, the new created column will have STRING AttributeType by default.

Specified by:
joinWithSeparatorMerge in interface AttributeColumnsMergeStrategiesController
Parameters:
table - Table of the columns to merge
columnsToMerge - Columns to merge
newColumnType - Type for the new column. If null, STRING will be used by default
newColumnTitle - Title for the new column
separator - Separator to put between each value
Returns:
The new created column

booleanLogicOperationsMerge

public AttributeColumn booleanLogicOperationsMerge(AttributeTable table,
                                                   AttributeColumn[] columnsToMerge,
                                                   AttributeColumnsMergeStrategiesController.BooleanOperations[] booleanOperations,
                                                   java.lang.String newColumnTitle)
Description copied from interface: AttributeColumnsMergeStrategiesController

Strategy to apply only to all boolean columns. Merges various columns into a new boolean column allowing to define each operation to apply between each pair of columns to merge.

The length of the operations array must be the length of the columns array-1, or IllegalArgumentException will be thrown.

Specified by:
booleanLogicOperationsMerge in interface AttributeColumnsMergeStrategiesController
Parameters:
table - Table of the columns to merge
columnsToMerge - Boolean columns to merge
booleanOperations - Boolean operations to apply
newColumnTitle - Title for the new column
Returns:
The new created column

mergeNumericColumnsToTimeInterval

public AttributeColumn mergeNumericColumnsToTimeInterval(AttributeTable table,
                                                         AttributeColumn startColumn,
                                                         AttributeColumn endColumn,
                                                         double defaultStart,
                                                         double defaultEnd)
Description copied from interface: AttributeColumnsMergeStrategiesController

Merge 1 or 2 columns creating a time interval for each row. Values of the columns will be expected as numbers

Only one of the 2 column could be null, and its corresponding start/end default will be used.

Columns can be of any type. If not numeric, their values will be parsed.

Default start and end values will be used when the columns don't have a value or it can't be parsed to a double.

When start > end for any reason:

Specified by:
mergeNumericColumnsToTimeInterval in interface AttributeColumnsMergeStrategiesController
Parameters:
table - Table of the columns, can't be null or wrong
startColumn - Column to use as start value
endColumn - Column to use as end value
defaultStart - Default start value
defaultEnd - Default end value
Returns:
Time interval column

mergeDateColumnsToTimeInterval

public AttributeColumn mergeDateColumnsToTimeInterval(AttributeTable table,
                                                      AttributeColumn startColumn,
                                                      AttributeColumn endColumn,
                                                      java.text.SimpleDateFormat dateFormat,
                                                      java.lang.String defaultStartDate,
                                                      java.lang.String defaultEndDate)
Description copied from interface: AttributeColumnsMergeStrategiesController

Merge 1 or 2 columns creating a time interval for each row. Values of the columns will be expected as dates in the given date format

Only one of the 2 column could be null, and its corresponding start/end default will be used.

Columns can be of any type.

Default start and end values will be used when the columns don't have a value or it can't be parsed to a date. If a default value can't be parsed to a date, infinity will be used as default instead.

When start > end for any reason:

Specified by:
mergeDateColumnsToTimeInterval in interface AttributeColumnsMergeStrategiesController
Parameters:
table - Table of the columns, can't be null or wrong
startColumn - Column to use as start value
endColumn - Column to use as end value
dateFormat - Format for the dates, can't be null
defaultStartDate - Default date to use as start if it can be parsed
defaultEndDate - Default date to use as end if it can be parsed
Returns:
Time interval column

averageNumberMerge

public AttributeColumn averageNumberMerge(AttributeTable table,
                                          AttributeColumn[] columnsToMerge,
                                          java.lang.String newColumnTitle)
Description copied from interface: AttributeColumnsMergeStrategiesController

Merges any combination of number or number list columns, calculating the average of all not null values and puts the result of each row in a new column of BIGDECIMAL AttributeType.

Specified by:
averageNumberMerge in interface AttributeColumnsMergeStrategiesController
Parameters:
table - Table of the columns to merge
columnsToMerge - Number or number list columns
newColumnTitle - Title for the new column
Returns:
The new created column

firstQuartileNumberMerge

public AttributeColumn firstQuartileNumberMerge(AttributeTable table,
                                                AttributeColumn[] columnsToMerge,
                                                java.lang.String newColumnTitle)
Description copied from interface: AttributeColumnsMergeStrategiesController

Merges any combination of number or number list columns, calculating the first quartile (Q1) of all not null values and puts the result of each row in a new column of BIGDECIMAL AttributeType.

Specified by:
firstQuartileNumberMerge in interface AttributeColumnsMergeStrategiesController
Parameters:
table - Table of the columns to merge
columnsToMerge - Number or number list columns
newColumnTitle - Title for the new column
Returns:
The new created column

medianNumberMerge

public AttributeColumn medianNumberMerge(AttributeTable table,
                                         AttributeColumn[] columnsToMerge,
                                         java.lang.String newColumnTitle)
Description copied from interface: AttributeColumnsMergeStrategiesController

Merges any combination of number or number list columns, calculating the median of all not null values and puts the result of each row in a new column of BIGDECIMAL AttributeType.

Specified by:
medianNumberMerge in interface AttributeColumnsMergeStrategiesController
Parameters:
table - Table of the columns to merge
columnsToMerge - Number or number list columns
newColumnTitle - Title for the new column
Returns:
The new created column

thirdQuartileNumberMerge

public AttributeColumn thirdQuartileNumberMerge(AttributeTable table,
                                                AttributeColumn[] columnsToMerge,
                                                java.lang.String newColumnTitle)
Description copied from interface: AttributeColumnsMergeStrategiesController

Merges any combination of number or number list columns, calculating the third quartile (Q3) of all not null values and puts the result of each row in a new column of BIGDECIMAL AttributeType.

Specified by:
thirdQuartileNumberMerge in interface AttributeColumnsMergeStrategiesController
Parameters:
table - Table of the columns to merge
columnsToMerge - Number or number list columns
newColumnTitle - Title for the new column
Returns:
The new created column

interQuartileRangeNumberMerge

public AttributeColumn interQuartileRangeNumberMerge(AttributeTable table,
                                                     AttributeColumn[] columnsToMerge,
                                                     java.lang.String newColumnTitle)
Description copied from interface: AttributeColumnsMergeStrategiesController

Merges any combination of number or number list columns, calculating the interquartile range (IQR) of all not null values and puts the result of each row in a new column of BIGDECIMAL AttributeType.

Specified by:
interQuartileRangeNumberMerge in interface AttributeColumnsMergeStrategiesController
Parameters:
table - Table of the columns to merge
columnsToMerge - Number or number list columns
newColumnTitle - Title for the new column
Returns:
The new created column

sumNumbersMerge

public AttributeColumn sumNumbersMerge(AttributeTable table,
                                       AttributeColumn[] columnsToMerge,
                                       java.lang.String newColumnTitle)
Description copied from interface: AttributeColumnsMergeStrategiesController

Merges any combination of number or number list columns, calculating the sum of all not null values and puts the result of each row in a new column of BIGDECIMAL AttributeType.

Specified by:
sumNumbersMerge in interface AttributeColumnsMergeStrategiesController
Parameters:
table - Table of the columns to merge
columnsToMerge - Number or number list columns
newColumnTitle - Title for the new column
Returns:
The new created column

minValueNumbersMerge

public AttributeColumn minValueNumbersMerge(AttributeTable table,
                                            AttributeColumn[] columnsToMerge,
                                            java.lang.String newColumnTitle)
Description copied from interface: AttributeColumnsMergeStrategiesController
Merges any combination of number or number list columns, calculating the minimum value of all not null values and puts the result of each row in a new column of BIGDECIMAL AttributeType.

Specified by:
minValueNumbersMerge in interface AttributeColumnsMergeStrategiesController
Parameters:
table - Table of the columns to merge
columnsToMerge - Number or number list columns
newColumnTitle - Title for the new column
Returns:
The new created column

maxValueNumbersMerge

public AttributeColumn maxValueNumbersMerge(AttributeTable table,
                                            AttributeColumn[] columnsToMerge,
                                            java.lang.String newColumnTitle)
Description copied from interface: AttributeColumnsMergeStrategiesController

Merges any combination of number or number list columns, calculating the maximum value of all not null values and puts the result of each row in a new column of BIGDECIMAL AttributeType.

Specified by:
maxValueNumbersMerge in interface AttributeColumnsMergeStrategiesController
Parameters:
table - Table of the columns to merge
columnsToMerge - Number or number list columns
newColumnTitle - Title for the new column
Returns:
The new created column

Gephi Toolkit Javadoc