All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.landawn.abacus.DataSet Maven / Gradle / Ivy

There is a newer version: 1.10.1
Show newest version
/*
 * Copyright (c) 2015, Haiyang Li.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.landawn.abacus;

import java.io.File;
import java.io.OutputStream;
import java.io.Writer;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.Map;

import com.landawn.abacus.exception.UncheckedIOException;
import com.landawn.abacus.util.BiIterator;
import com.landawn.abacus.util.ImmutableList;
import com.landawn.abacus.util.ListMultimap;
import com.landawn.abacus.util.Multimap;
import com.landawn.abacus.util.NoCachingNoUpdating.DisposableObjArray;
import com.landawn.abacus.util.Pair;
import com.landawn.abacus.util.Properties;
import com.landawn.abacus.util.Sheet;
import com.landawn.abacus.util.TriIterator;
import com.landawn.abacus.util.Triple;
import com.landawn.abacus.util.Try;
import com.landawn.abacus.util.Tuple.Tuple2;
import com.landawn.abacus.util.Tuple.Tuple3;
import com.landawn.abacus.util.u.Optional;
import com.landawn.abacus.util.function.Function;
// import com.landawn.abacus.util.function.Function;
import com.landawn.abacus.util.function.IntFunction;
import com.landawn.abacus.util.stream.Collector;
import com.landawn.abacus.util.stream.Stream;

/**
 *
 * @since 0.8
 * 
 * @author Haiyang Li
 * 
 * @see com.landawn.abacus.util.DataSetUtil
 * @see com.landawn.abacus.util.Build.DataSetBuilder
 * @see com.landawn.abacus.util.JdbcUtil
 * @see com.landawn.abacus.util.CSVUtil
 * @see com.landawn.abacus.util.function.IntFunction
 * @see com.landawn.abacus.util.Fn.Factory
 * @see com.landawn.abacus.util.Clazz
 * @see com.landawn.abacus.util.N#newEmptyDataSet()
 * @see com.landawn.abacus.util.N#newEmptyDataSet(Collection)
 * @see com.landawn.abacus.util.N#newDataSet(Map)
 * @see com.landawn.abacus.util.N#newDataSet(Collection)
 * @see com.landawn.abacus.util.N#newDataSet(Collection, Collection)
 * @see com.landawn.abacus.util.N#newDataSet(String, String, Map)
 */
public interface DataSet {

    //    /**
    //     * Returns the entity name associated with the query.
    //     *
    //     * @return
    //     */
    //    String entityName();
    //
    //    /**
    //     * Returns the target entity class associated with the query.
    //     *
    //     * @return
    //     */
    //     Class entityClass();

    /**
     * Return the column name list in this DataSet.
     */
    ImmutableList columnNameList();

    /**
     * Method getColumnName.
     *
     * @param columnIndex
     * @return
     */
    String getColumnName(int columnIndex);

    /**
     * Method getColumnIndex.
     *
     * @param columnName
     * @return -1 if the specified columnName is not found
     */
    int getColumnIndex(String columnName);

    /**
     * -1 is set to the element in the returned array if the mapping column name is not included in this DataSet
     *
     * @param columnNames
     * @return
     */
    int[] getColumnIndexes(Collection columnNames);

    /**
     *
     * @param columnName
     * @return
     */
    boolean containsColumn(String columnName);

    /**
     * Check if this DataSet contains all the specified columns.
     *
     * @param columnNames
     * @return true if all the specified columns are included in the this DataSet
     */
    boolean containsAllColumns(Collection columnNames);

    /**
     *
     * @param columnName
     * @param newColumnName
     */
    void renameColumn(String columnName, String newColumnName);

    /**
     * 
     * @param oldNewNames
     */
    void renameColumns(Map oldNewNames);

    /**
     *
     * @param columnName
     * @param func
     */
     void renameColumn(String columnName, Try.Function func) throws E;

    /**
     *
     * @param columnNames
     * @param func
     */
     void renameColumns(Collection columnNames, Try.Function func) throws E;

    /**
     * 
     * @param func
     */
     void renameColumns(Try.Function func) throws E;

    void moveColumn(String columnName, int newPosition);

    void moveColumns(Map columnNameNewPositionMap);

    /**
     * Swap the positions of the two specified columns.
     * 
     * @param columnNameA
     * @param columnNameB
     */
    void swapColumns(String columnNameA, String columnNameB);

    /**
     * Move the specified row to the new position.
     * 
     * @param rowIndex
     * @param newRowIndex
     */
    void moveRow(int rowIndex, int newRowIndex);

    /**
     * Swap the positions of the two specified rows.
     * 
     * @param columnNameA
     * @param columnNameB
     */
    void swapRows(int rowIndexA, int rowIndexB);

    /**
     * There is NO underline auto-conversion from column value to target type: {@code T}.
     * So the column values must be the type which is assignable to target type.
     *
     * @param rowIndex
     * @param columnIndex
     * @return
     */
     T get(int rowIndex, int columnIndex);

    /**
     * There is NO underline auto-conversion from column value to target type: {@code T}.
     * So the column values must be the type which is assignable to target type.
     * 
     * @param targetType
     * @param rowIndex
     * @param columnIndex
     * @return
     * @deprecated may be misused because it implies there is an underline auto-conversion from column values to target return type but actually there is not.
     */
    @Deprecated
     T get(Class targetType, int rowIndex, int columnIndex);

    /**
     *
     * @param rowIndex
     * @param columnIndex
     * @param element
     */
    void set(int rowIndex, int columnIndex, Object element);

    /**
     * 
     * @param rowIndex
     * @param columnIndex
     * @return
     */
    boolean isNull(int rowIndex, int columnIndex);

    /** 
     * There is NO underline auto-conversion from column value to target type: {@code T}.
     * So the column values must be the type which is assignable to target type.
     *
     * @param columnIndex
     * @return
     */
     T get(int columnIndex);

    /** 
     * There is NO underline auto-conversion from column value to target type: {@code T}.
     * So the column values must be the type which is assignable to target type.
     *
     * @param columnName
     * @return
     */
     T get(String columnName);

    /**
     * There is NO underline auto-conversion from column value to target type: {@code T}.
     * So the column values must be the type which is assignable to target type.
     *
     * @param targetType
     * @param columnIndex
     * @return
     * @deprecated may be misused because it implies there is an underline auto-conversion from column values to target return type but actually there is not.
     */
    @Deprecated
     T get(Class targetType, int columnIndex);

    /** 
     * There is NO underline auto-conversion from column value to target type: {@code T}.
     * So the column values must be the type which is assignable to target type.
     *
     * @param targetType
     * @param columnName
     * @return
     * @deprecated may be misused because it implies there is an underline auto-conversion from column values to target return type but actually there is not.
     */
    @Deprecated
     T get(Class targetType, String columnName);

    /**
     * Returns the value from the current row and specified column if the specified {@code columnIndex} is equal or bigger than zero, 
     * or the specified {@code defaultValue} otherwise.
     * 
* There is NO underline auto-conversion from column value to target type: {@code T}. * So the column values must be the type which is assignable to target type. * * @param columnIndex * @param defaultValue * @return * @deprecated */ @Deprecated T getOrDefault(int columnIndex, T defaultValue); /** * Returns the value from the current row and specified column if the specified {@code columnName} exists, * or the specified {@code defaultValue} otherwise. *
* There is NO underline auto-conversion from column value to target type: {@code T}. * So the column values must be the type which is assignable to target type. * * @param columnName * @param defaultValue * @return * @deprecated */ @Deprecated T getOrDefault(String columnName, T defaultValue); /** * Return default value (false) if the property is null. *
* There is NO underline auto-conversion from column value to target type: {@code Boolean}. * So the column values must be the type which is assignable to target type. * * @param columnIndex * @return */ boolean getBoolean(int columnIndex); /** * Return default value (false) if the property is null. *
* There is NO underline auto-conversion from column value to target type: {@code Boolean}. * So the column values must be the type which is assignable to target type. * * @param columnName * @return */ boolean getBoolean(String columnName); /** * Return default value (0) if the property is null. *
* There is NO underline auto-conversion from column value to target type: {@code Character}. * So the column values must be the type which is assignable to target type. * * @param columnIndex * @return */ char getChar(int columnIndex); /** * Return default value (0) if the property is null. *
* There is NO underline auto-conversion from column value to target type: {@code Character}. * So the column values must be the type which is assignable to target type. * * @param columnName * @return */ char getChar(String columnName); /** * Return default value (0) if the property is null. Return Number.byteValue() otherwise. *
* There is NO underline auto-conversion from column value to target type: {@code Byte}. * So the column values must be the type which is assignable to target type, or {@code Number}. * * @param columnIndex * @return */ byte getByte(int columnIndex); /** * Return default value (0) if the property is null. Return Number.byteValue() otherwise. *
* There is NO underline auto-conversion from column value to target type: {@code Byte}. * So the column values must be the type which is assignable to target type, or {@code Number}. * * @param columnName * @return */ byte getByte(String columnName); /** * Return default value (0) if the property is null. Return Number.shortValue() otherwise. *
* There is NO underline auto-conversion from column value to target type: {@code Short}. * So the column values must be the type which is assignable to target type, or {@code Number}. * * @param columnIndex * @return */ short getShort(int columnIndex); /** * Return default value (0) if the property is null. Return Number.shortValue() otherwise. *
* There is NO underline auto-conversion from column value to target type: {@code Short}. * So the column values must be the type which is assignable to target type, or {@code Number}. * * @param columnName * @return */ short getShort(String columnName); /** * Return default value (0) if the property is null. Return Number.intValue() otherwise. *
* There is NO underline auto-conversion from column value to target type: {@code Integer}. * So the column values must be the type which is assignable to target type, or {@code Number}. * * @param columnIndex * @return */ int getInt(int columnIndex); /** * Return default value (0) if the property is null. Return Number.intValue() otherwise. *
* There is NO underline auto-conversion from column value to target type: {@code Integer}. * So the column values must be the type which is assignable to target type, or {@code Number}. * * @param columnName * @return */ int getInt(String columnName); /** * Return default value (0) if the property is null. Return Number.longValue() otherwise. *
* There is NO underline auto-conversion from column value to target type: {@code Long}. * So the column values must be the type which is assignable to target type, or {@code Number}. * * @param columnIndex * @return */ long getLong(int columnIndex); /** * Return default value (0) if the property is null. Return Number.longValue() otherwise. *
* There is NO underline auto-conversion from column value to target type: {@code Long}. * So the column values must be the type which is assignable to target type, or {@code Number}. * * @param columnName * @return */ long getLong(String columnName); /** * Return default value (0f) if the property is null. Return Number.floatValue() otherwise. *
* There is NO underline auto-conversion from column value to target type: {@code Float}. * So the column values must be the type which is assignable to target type, or {@code Number}. * * @param columnIndex * @return */ float getFloat(int columnIndex); /** * Return default value (0f) if the property is null. Return Number.floatValue() otherwise. *
* There is NO underline auto-conversion from column value to target type: {@code Float}. * So the column values must be the type which is assignable to target type, or {@code Number}. * * @param columnName * @return */ float getFloat(String columnName); /** * Return default value (0d) if the property is null. Return Number.doubleValue() otherwise. *
* There is NO underline auto-conversion from column value to target type: {@code Double}. * So the column values must be the type which is assignable to target type, or {@code Number}. * * @param columnIndex * @return */ double getDouble(int columnIndex); /** * Return default value (0d) if the property is null. Return Number.doubleValue() otherwise. *
* There is NO underline auto-conversion from column value to target type: {@code Double}. * So the column values must be the type which is assignable to target type, or {@code Number}. * * @param columnName * @return */ double getDouble(String columnName); /** * * @param columnIndex * @return */ boolean isNull(int columnIndex); /** * * @param columnName * @return */ boolean isNull(String columnName); /** * Method set. * * @param columnIndex * @param value */ void set(int columnIndex, Object value); /** * Method set. * * @param columnName * @param value */ void set(String columnName, Object value); /** * Must NOT modify the returned list. * * @param columnIndex * @return */ ImmutableList getColumn(int columnIndex); /** * Must NOT modify the returned list. * * @param columnName * @return */ ImmutableList getColumn(String columnName); List copyOfColumn(String columnName); /** * Method addColumn. * * @param columnName * @param column */ void addColumn(String columnName, List column); /** * Method addColumn. * * @param columnIndex position to add. * @param columnName * @param column */ void addColumn(int columnIndex, String columnName, List column); /** * Generate the new column values from the specified column by the specified Function. * @param newColumnName * @param fromColumnName * @param func */ void addColumn(String newColumnName, String fromColumnName, Try.Function func) throws E; /** * Generate the new column values from the specified column by the specified Function. * * @param columnIndex * @param newColumnName * @param fromColumnName * @param func */ void addColumn(int columnIndex, String newColumnName, String fromColumnName, Try.Function func) throws E; /** * Generate the new column values from the specified columns by the specified Function. * @param newColumnName * @param fromColumnNames * @param func DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) */ void addColumn(String newColumnName, Collection fromColumnNames, Try.Function func) throws E; /** * Generate the new column values from the specified columns by the specified Function. * * @param columnIndex * @param newColumnName * @param fromColumnNames * @param func DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) */ void addColumn(int columnIndex, String newColumnName, Collection fromColumnNames, Try.Function func) throws E; /** * Generate the new column values from the specified columns by the specified Function. * @param newColumnName * @param fromColumnNames * @param func */ void addColumn(String newColumnName, Tuple2 fromColumnNames, Try.BiFunction func) throws E; /** * Generate the new column values from the specified columns by the specified Function. * * @param columnIndex * @param newColumnName * @param fromColumnNames * @param func */ void addColumn(int columnIndex, String newColumnName, Tuple2 fromColumnNames, Try.BiFunction func) throws E; /** * Generate the new column values from the specified columns by the specified Function. * @param newColumnName * @param fromColumnNames * @param func */ void addColumn(String newColumnName, Tuple3 fromColumnNames, Try.TriFunction func) throws E; /** * Generate the new column values from the specified columns by the specified Function. * * @param columnIndex * @param newColumnName * @param fromColumnNames * @param func */ void addColumn(int columnIndex, String newColumnName, Tuple3 fromColumnNames, Try.TriFunction func) throws E; /** * Remove the column with the specified columnName from this DataSet. * * @param columnName */ List removeColumn(String columnName); /** * Remove the column(s) with the specified columnNames from this DataSet. * * @param columnNames */ void removeColumns(Collection columnNames); /** * Remove the column(s) whose name matches the specified {@code filter} * * @param filter column name filter * @throws E */ void removeColumns(Try.Predicate filter) throws E; /** * Remove the column(s) whose name matches the specified {@code filter} * * @param filter column name filter * @throws E * @deprecated replaced by {@code removeColumns}. */ @Deprecated void removeColumnsIf(Try.Predicate filter) throws E; /** * Update the values of the specified column by the specified Try.Function. * * @param columnName * @param func */ void updateColumn(String columnName, Try.Function func) throws E; /** * Update the values of the specified columns one by one with the specified Try.Function. * * @param columnNames * @param func */ void updateColumns(Collection columnNames, Try.Function func) throws E; /** * Convert the specified column to target type. * * @param columnName * @param targetType */ void convertColumn(String columnName, Class targetType); /** * Convert the specified columns to target types. * * @param columnTargetTypes */ void convertColumns(Map> columnTargetTypes); // // /** // * convert the specified columns to target types. // * // * @param targetColumnTypes fill the element with null if don't wan to convert the target column. // */ // void convertColumn(Class[] targetColumnTypes); // /** * * @param columnNames * @param newColumnName * @param newColumnClass it can be Object[]/List/Set/Map/Entity * @return */ void combineColumns(Collection columnNames, String newColumnName, Class newColumnClass); /** * * @param columnNames * @param newColumnName * @param combineFunc DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @throws E */ void combineColumns(Collection columnNames, String newColumnName, Try.Function combineFunc) throws E; void combineColumns(Tuple2 columnNames, String newColumnName, Try.BiFunction combineFunc) throws E; void combineColumns(Tuple3 columnNames, String newColumnName, Try.TriFunction combineFunc) throws E; /** * * @param columnNameFilter * @param newColumnName * @param newColumnClass it can be Object[]/List/Set/Map/Entity * @throws E */ void combineColumns(Try.Predicate columnNameFilter, String newColumnName, Class newColumnClass) throws E; /** * * @param columnNameFilter * @param newColumnName * @param combineFunc DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @throws E * @throws E2 */ void combineColumns(Try.Predicate columnNameFilter, String newColumnName, Try.Function combineFunc) throws E, E2; void divideColumn(String columnName, Collection newColumnNames, Try.Function, E> divideFunc) throws E; void divideColumn(String columnName, Collection newColumnNames, Try.BiConsumer output) throws E; void divideColumn(String columnName, Tuple2 newColumnNames, Try.BiConsumer, E> output) throws E; void divideColumn(String columnName, Tuple3 newColumnNames, Try.BiConsumer, E> output) throws E; /** * * @param row can be Object[]/List/Map/Entity with getter/setter methods */ void addRow(Object row); /** * * @param row can be Object[]/List/Map/Entity with getter/setter methods */ void addRow(int rowIndex, Object row); /** * * @param rowIndex */ void removeRow(int rowIndex); /** * * @param indices */ void removeRows(int... indices); /** * * @param inclusiveFromRowIndex * @param exclusiveToRowIndex */ void removeRowRange(int inclusiveFromRowIndex, int exclusiveToRowIndex); /** * Update the values in the specified row with the specified Try.Function. * * @param rowIndex * @param func */ void updateRow(int rowIndex, Try.Function func) throws E; /** * Update the values in the specified rows one by one with the specified Try.Function. * * @param indices * @param func */ void updateRows(int[] indices, Try.Function func) throws E; /** * Update all the values in this DataSet with the specified Try.Function. * * @param func */ void updateAll(Try.Function func) throws E; /** * Replace all the values in this DataSet with the specified new value if it matches the specified condition. * * @param func * @param newValue */ void replaceIf(Try.Predicate func, Object newValue) throws E; /** * Returns the current row number. * * @return */ int currentRowNum(); /** * Move the cursor to the specified row. * * @param rowNum * @return this object itself. */ DataSet absolute(int rowNum); /** * * @param rowNum * @return */ Object[] getRow(int rowNum); /** * * @param rowClass it can be Object[]/List/Set/Map/Entity * @param rowNum * @return */ T getRow(Class rowClass, int rowNum); /** * * @param rowClass it can be Object[]/List/Set/Map/Entity * @param columnNames * @param rowNum * @return */ T getRow(Class rowClass, Collection columnNames, int rowNum); /** * * @param rowSupplier it can be Object[]/List/Set/Map/Entity * @param rowNum * @return */ T getRow(IntFunction rowSupplier, int rowNum); /** * * @param rowSupplier it can be Object[]/List/Set/Map/Entity * @param columnNames * @param rowNum * @return */ T getRow(IntFunction rowSupplier, Collection columnNames, int rowNum); /** * * @return {@code Optional} */ Optional firstRow(); /** * * @param rowClass it can be Object[]/List/Set/Map/Entity * @return {@code Optional} */ Optional firstRow(Class rowClass); /** * * @param rowClass it can be Object[]/List/Set/Map/Entity * @param columnNames * @return {@code Optional} */ Optional firstRow(Class rowClass, Collection columnNames); /** * * @param rowSupplier it can be Object[]/List/Set/Map/Entity * @return {@code Optional} */ Optional firstRow(IntFunction rowSupplier); /** * * @param rowSupplier it can be Object[]/List/Set/Map/Entity * @param columnNames * @return {@code Optional} */ Optional firstRow(IntFunction rowSupplier, Collection columnNames); /** * * @return {@code Optional} */ Optional lastRow(); /** * * @param rowClass it can be Object[]/List/Set/Map/Entity * @return {@code Optional} */ Optional lastRow(Class rowClass); /** * * @param rowClass it can be Object[]/List/Set/Map/Entity * which can be object array/list/set/map/entity. * @param columnNames * @return {@code Optional} */ Optional lastRow(Class rowClass, Collection columnNames); /** * * @param rowSupplier it can be Object[]/List/Set/Map/Entity * @return {@code Optional} */ Optional lastRow(IntFunction rowSupplier); /** * * @param rowSupplier it can be Object[]/List/Set/Map/Entity * @param columnNames * @return {@code Optional} */ Optional lastRow(IntFunction rowSupplier, Collection columnNames); /** * Performs the given action for each row of the {@code DataSet} * until all rows have been processed or the action throws an * exception. * * @param action DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) */ void forEach(Try.Consumer action) throws E; /** * Performs the given action for each row of the {@code DataSet} * until all rows have been processed or the action throws an * exception. * * @param columnNames * @param action DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) */ void forEach(Collection columnNames, Try.Consumer action) throws E; /** * Performs the given action for each row of the {@code DataSet} * until all rows have been processed or the action throws an * exception. * * @param fromRowIndex * @param toRowIndex * @param action DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) */ void forEach(int fromRowIndex, int toRowIndex, Try.Consumer action) throws E; /** * Performs the given action for each row of the {@code DataSet} * until all rows have been processed or the action throws an * exception. * * @param columnNames * @param fromRowIndex * @param toRowIndex * @param action DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) */ void forEach(Collection columnNames, int fromRowIndex, int toRowIndex, Try.Consumer action) throws E; void forEach(Tuple2 columnNames, Try.BiConsumer action) throws E; void forEach(Tuple2 columnNames, int fromRowIndex, int toRowIndex, Try.BiConsumer action) throws E; void forEach(Tuple3 columnNames, Try.TriConsumer action) throws E; void forEach(Tuple3 columnNames, int fromRowIndex, int toRowIndex, Try.TriConsumer action) throws E; /** * * @return */ List toList(); /** * * @param fromRowIndex * @param toRowIndex * @return */ List toList(int fromRowIndex, int toRowIndex); /** * * @param rowClass it can be Object[]/List/Set/Map/Entity * @return */ List toList(Class rowClass); /** * * @param rowClass it can be Object[]/List/Set/Map/Entity * @param fromRowIndex * @param toRowIndex * @return */ List toList(Class rowClass, int fromRowIndex, int toRowIndex); /** * * @param rowClass it can be Object[]/List/Set/Map/Entity * @param fromRowIndex * @param toRowIndex * @return */ List toList(Class rowClass, Collection columnNames); /** * * @param rowClass it can be Object[]/List/Set/Map/Entity * @param fromRowIndex * @param toRowIndex * @return */ List toList(Class rowClass, Collection columnNames, int fromRowIndex, int toRowIndex); /** * * @param rowSupplier it can be Object[]/List/Set/Map/Entity * @return */ List toList(IntFunction rowSupplier); /** * * @param rowSupplier it can be Object[]/List/Set/Map/Entity * @param fromRowIndex * @param toRowIndex * @return */ List toList(IntFunction rowSupplier, int fromRowIndex, int toRowIndex); /** * * @param rowSupplier it can be Object[]/List/Set/Map/Entity * @param fromRowIndex * @param toRowIndex * @return */ List toList(IntFunction rowSupplier, Collection columnNames); /** * * @param rowSupplier it can be Object[]/List/Set/Map/Entity * @param fromRowIndex * @param toRowIndex * @return */ List toList(IntFunction rowSupplier, Collection columnNames, int fromRowIndex, int toRowIndex); /** * * @param keyColumnName * @param valueColumnName * @return */ Map toMap(String keyColumnName, String valueColumnName); /** * * @param keyColumnName * @param valueColumnName * @param fromRowIndex * @param toRowIndex * @return */ Map toMap(String keyColumnName, String valueColumnName, int fromRowIndex, int toRowIndex); /** * * @param keyColumnName * @param valueColumnName * @param fromRowIndex * @param toRowIndex * @param supplier * @return */ > M toMap(String keyColumnName, String valueColumnName, int fromRowIndex, int toRowIndex, IntFunction supplier); /** * * @param rowClass it can be Object[]/List/Set/Map/Entity * @param keyColumnName * @param valueColumnNames * @return */ Map toMap(Class rowClass, String keyColumnName, Collection valueColumnNames); /** * * @param rowClass it can be Object[]/List/Set/Map/Entity * @param keyColumnName * @param valueColumnNames * @param fromRowIndex * @param toRowIndex * @return */ Map toMap(Class rowClass, String keyColumnName, Collection valueColumnNames, int fromRowIndex, int toRowIndex); /** * * @param rowClass it can be Object[]/List/Set/Map/Entity * @param keyColumnName * @param valueColumnNames * @param fromRowIndex * @param toRowIndex * @param supplier * @return */ > M toMap(Class rowClass, String keyColumnName, Collection valueColumnNames, int fromRowIndex, int toRowIndex, IntFunction supplier); /** * * @param rowSupplier it can be Object[]/List/Set/Map/Entity * @param keyColumnName * @param valueColumnNames * @return */ Map toMap(IntFunction rowSupplier, String keyColumnName, Collection valueColumnNames); /** * * @param rowSupplier it can be Object[]/List/Set/Map/Entity * @param keyColumnName * @param valueColumnNames * @param fromRowIndex * @param toRowIndex * @return */ Map toMap(IntFunction rowSupplier, String keyColumnName, Collection valueColumnNames, int fromRowIndex, int toRowIndex); /** * * @param rowSupplier it can be Object[]/List/Set/Map/Entity * @param keyColumnName * @param valueColumnNames * @param fromRowIndex * @param toRowIndex * @param supplier * @return */ > M toMap(IntFunction rowSupplier, String keyColumnName, Collection valueColumnNames, int fromRowIndex, int toRowIndex, IntFunction supplier); /** * * @param keyColumnName * @param valueColumnName * @return */ ListMultimap toMultimap(String keyColumnName, String valueColumnName); /** * * @param keyColumnName * @param valueColumnName * @param fromRowIndex * @param toRowIndex * @return */ ListMultimap toMultimap(String keyColumnName, String valueColumnName, int fromRowIndex, int toRowIndex); /** * * @param keyColumnName * @param valueColumnName * @param fromRowIndex * @param toRowIndex * @param supplier * @return */ , M extends Multimap> M toMultimap(String keyColumnName, String valueColumnName, int fromRowIndex, int toRowIndex, IntFunction supplier); /** * * @param rowClass it can be Object[]/List/Set/Map/Entity * @param keyColumnName * @param valueColumnNames * @return */ ListMultimap toMultimap(Class rowClass, String keyColumnName, Collection valueColumnNames); /** * * @param rowClass it can be Object[]/List/Set/Map/Entity * @param keyColumnName * @param valueColumnNames * @param fromRowIndex * @param toRowIndex * @return */ ListMultimap toMultimap(Class rowClass, String keyColumnName, Collection valueColumnNames, int fromRowIndex, int toRowIndex); /** * * @param rowClass it can be Object[]/List/Set/Map/Entity * @param keyColumnName * @param valueColumnNames * @param fromRowIndex * @param toRowIndex * @param supplier * @return */ , M extends Multimap> M toMultimap(Class rowClass, String keyColumnName, Collection valueColumnNames, int fromRowIndex, int toRowIndex, IntFunction supplier); /** * * @param rowSupplier it can be Object[]/List/Set/Map/Entity * @param keyColumnName * @param valueColumnNames * @return */ ListMultimap toMultimap(IntFunction rowSupplier, String keyColumnName, Collection valueColumnNames); /** * * @param rowSupplier it can be Object[]/List/Set/Map/Entity * @param keyColumnName * @param valueColumnNames * @param fromRowIndex * @param toRowIndex * @return */ ListMultimap toMultimap(IntFunction rowSupplier, String keyColumnName, Collection valueColumnNames, int fromRowIndex, int toRowIndex); /** * * @param rowSupplier it can be Object[]/List/Set/Map/Entity * @param keyColumnName * @param valueColumnNames * @param fromRowIndex * @param toRowIndex * @param supplier * @return */ , M extends Multimap> M toMultimap(IntFunction rowSupplier, String keyColumnName, Collection valueColumnNames, int fromRowIndex, int toRowIndex, IntFunction supplier); /** * * @return */ String toJSON(); /** * * @param fromRowIndex * @param toRowIndex * @return */ String toJSON(int fromRowIndex, int toRowIndex); /** * * @param columnNames * @param fromRowIndex * @param toRowIndex * @return */ String toJSON(Collection columnNames, int fromRowIndex, int toRowIndex); /** * * @param out * @throws UncheckedIOException */ void toJSON(File out) throws UncheckedIOException; /** * * @param out * @param fromRowIndex * @param toRowIndex * @throws UncheckedIOException */ void toJSON(File out, int fromRowIndex, int toRowIndex) throws UncheckedIOException; /** * * @param out * @param columnNames * @param fromRowIndex * @param toRowIndex * @throws UncheckedIOException */ void toJSON(File out, Collection columnNames, int fromRowIndex, int toRowIndex) throws UncheckedIOException; /** * * @param os * @throws UncheckedIOException */ void toJSON(OutputStream out) throws UncheckedIOException; /** * * @param os * @param fromRowIndex * @param toRowIndex * @throws UncheckedIOException */ void toJSON(OutputStream out, int fromRowIndex, int toRowIndex) throws UncheckedIOException; /** * * @param os * @param columnNames * @param fromRowIndex * @param toRowIndex * @throws UncheckedIOException */ void toJSON(OutputStream out, Collection columnNames, int fromRowIndex, int toRowIndex) throws UncheckedIOException; /** * * @param os * @throws UncheckedIOException */ void toJSON(Writer out) throws UncheckedIOException; /** * * @param os * @param fromRowIndex * @param toRowIndex * @throws UncheckedIOException */ void toJSON(Writer out, int fromRowIndex, int toRowIndex) throws UncheckedIOException; /** * * @param os * @param columnNames * @param fromRowIndex * @param toRowIndex * @throws UncheckedIOException */ void toJSON(Writer out, Collection columnNames, int fromRowIndex, int toRowIndex) throws UncheckedIOException; /** * * @return */ String toXML(); /** * @param rowElementName * @return */ String toXML(String rowElementName); /** * * @param fromRowIndex * @param toRowIndex * @return */ String toXML(int fromRowIndex, int toRowIndex); /** * @param rowElementName * @param fromRowIndex * @param toRowIndex * @return */ String toXML(String rowElementName, int fromRowIndex, int toRowIndex); /** * * @param columnNames * @param fromRowIndex * @param toRowIndex * @return */ String toXML(Collection columnNames, int fromRowIndex, int toRowIndex); /** * @param rowElementName * @param columnNames * @param fromRowIndex * @param toRowIndex * @return */ String toXML(String rowElementName, Collection columnNames, int fromRowIndex, int toRowIndex); /** * @param out * @throws UncheckedIOException */ void toXML(File out) throws UncheckedIOException; /** * @param out * @param rowElementName * @throws UncheckedIOException */ void toXML(File out, String rowElementName) throws UncheckedIOException; /** * * @param out * @param fromRowIndex * @param toRowIndex * @throws UncheckedIOException */ void toXML(File out, int fromRowIndex, int toRowIndex) throws UncheckedIOException; /** * @param out * @param rowElementName * @param fromRowIndex * @param toRowIndex * @throws UncheckedIOException */ void toXML(File out, String rowElementName, int fromRowIndex, int toRowIndex) throws UncheckedIOException; /** * * @param out * @param columnNames * @param fromRowIndex * @param toRowIndex * @throws UncheckedIOException */ void toXML(File out, Collection columnNames, int fromRowIndex, int toRowIndex) throws UncheckedIOException; /** * @param out * @param rowElementName * @param columnNames * @param fromRowIndex * @param toRowIndex * @throws UncheckedIOException */ void toXML(File out, String rowElementName, Collection columnNames, int fromRowIndex, int toRowIndex) throws UncheckedIOException; /** * @param out * @throws UncheckedIOException */ void toXML(OutputStream out) throws UncheckedIOException; /** * @param out * @param rowElementName * @throws UncheckedIOException */ void toXML(OutputStream out, String rowElementName) throws UncheckedIOException; /** * * @param out * @param fromRowIndex * @param toRowIndex * @throws UncheckedIOException */ void toXML(OutputStream out, int fromRowIndex, int toRowIndex) throws UncheckedIOException; /** * @param out * @param rowElementName * @param fromRowIndex * @param toRowIndex * @throws UncheckedIOException */ void toXML(OutputStream out, String rowElementName, int fromRowIndex, int toRowIndex) throws UncheckedIOException; /** * * @param out * @param columnNames * @param fromRowIndex * @param toRowIndex * @throws UncheckedIOException */ void toXML(OutputStream out, Collection columnNames, int fromRowIndex, int toRowIndex) throws UncheckedIOException; /** * @param out * @param rowElementName * @param columnNames * @param fromRowIndex * @param toRowIndex * @throws UncheckedIOException */ void toXML(OutputStream out, String rowElementName, Collection columnNames, int fromRowIndex, int toRowIndex) throws UncheckedIOException; /** * @param out * @throws UncheckedIOException */ void toXML(Writer out) throws UncheckedIOException; /** * @param out * @param rowElementName * @throws UncheckedIOException */ void toXML(Writer out, String rowElementName) throws UncheckedIOException; /** * * @param out * @param fromRowIndex * @param toRowIndex * @throws UncheckedIOException */ void toXML(Writer out, int fromRowIndex, int toRowIndex) throws UncheckedIOException; /** * @param out * @param rowElementName * @param fromRowIndex * @param toRowIndex * @throws UncheckedIOException */ void toXML(Writer out, String rowElementName, int fromRowIndex, int toRowIndex) throws UncheckedIOException; /** * * @param out * @param columnNames * @param fromRowIndex * @param toRowIndex * @throws UncheckedIOException */ void toXML(Writer out, Collection columnNames, int fromRowIndex, int toRowIndex) throws UncheckedIOException; /** * @param out * @param rowElementName * @param columnNames * @param fromRowIndex * @param toRowIndex * @throws UncheckedIOException */ void toXML(Writer out, String rowElementName, Collection columnNames, int fromRowIndex, int toRowIndex) throws UncheckedIOException; /** * */ String toCSV(); /** * * @param columnNames * @param fromRowIndex * @param toRowIndex */ String toCSV(Collection columnNames, int fromRowIndex, int toRowIndex); /** * * @param writeTitle * @param quoteValue * @return */ String toCSV(boolean writeTitle, boolean quoteValue); /** * * @param columnNames * @param fromRowIndex * @param toRowIndex * @param writeTitle * @param quoteValue * @return */ String toCSV(Collection columnNames, int fromRowIndex, int toRowIndex, boolean writeTitle, boolean quoteValue); /** * * @param out * @throws UncheckedIOException */ void toCSV(File out) throws UncheckedIOException; /** * * @param out * @param columnNames * @param fromRowIndex * @param toRowIndex * @throws UncheckedIOException */ void toCSV(File out, Collection columnNames, int fromRowIndex, int toRowIndex) throws UncheckedIOException; /** * * @param out * @param writeTitle * @param quoteValue * @throws UncheckedIOException */ void toCSV(File out, boolean writeTitle, boolean quoteValue) throws UncheckedIOException; /** * * @param out * @param columnNames * @param fromRowIndex * @param toRowIndex * @param writeTitle * @param quoteValue * @throws UncheckedIOException */ void toCSV(File out, Collection columnNames, int fromRowIndex, int toRowIndex, boolean writeTitle, boolean quoteValue) throws UncheckedIOException; /** * * @param out * @throws UncheckedIOException */ void toCSV(OutputStream out); /** * * @param out * @param columnNames * @param fromRowIndex * @param toRowIndex * @throws UncheckedIOException */ void toCSV(OutputStream out, Collection columnNames, int fromRowIndex, int toRowIndex) throws UncheckedIOException; /** * * @param out * @param writeTitle * @param quoteValue * @throws UncheckedIOException */ void toCSV(OutputStream out, boolean writeTitle, boolean quoteValue) throws UncheckedIOException; /** * * @param out * @param columnNames * @param fromRowIndex * @param toRowIndex * @param writeTitle * @param quoteValue * @throws UncheckedIOException */ void toCSV(OutputStream out, Collection columnNames, int fromRowIndex, int toRowIndex, boolean writeTitle, boolean quoteValue) throws UncheckedIOException; /** * * @param out * @throws UncheckedIOException */ void toCSV(Writer out); /** * * @param out * @param columnNames * @param fromRowIndex * @param toRowIndex * @throws UncheckedIOException */ void toCSV(Writer out, Collection columnNames, int fromRowIndex, int toRowIndex) throws UncheckedIOException; /** * * @param out * @param writeTitle * @param quoteValue * @throws UncheckedIOException */ void toCSV(Writer out, boolean writeTitle, boolean quoteValue) throws UncheckedIOException; /** * * @param out * @param columnNames * @param fromRowIndex * @param toRowIndex * @param writeTitle * @param quoteValue * @throws UncheckedIOException */ void toCSV(Writer out, Collection columnNames, int fromRowIndex, int toRowIndex, boolean writeTitle, boolean quoteValue) throws UncheckedIOException; /** * * @param columnName specifying the column to group by. * @return */ DataSet groupBy(String columnName); /** * * @param columnName * @param aggregateResultColumnName * @param aggregateOnColumnName * @param collector * @return */ DataSet groupBy(String columnName, String aggregateResultColumnName, String aggregateOnColumnName, Collector collector); /** * * @param columnName * @param aggregateResultColumnName * @param aggregateOnColumnName * @param func * @return * @throws E */ DataSet groupBy(String columnName, String aggregateResultColumnName, String aggregateOnColumnName, Try.Function, ?, E> func) throws E; /** * * @param columnName * @param aggregateResultColumnName * @param aggregateOnColumnNames * @param collector * @return */ DataSet groupBy(String columnName, String aggregateResultColumnName, Collection aggregateOnColumnNames, Collector collector); /** * * @param columnName * @param aggregateResultColumnName * @param aggregateOnColumnNames * @param rowMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @param collector * @return * @throws E */ DataSet groupBy(String columnName, String aggregateResultColumnName, Collection aggregateOnColumnNames, Try.Function rowMapper, Collector collector) throws E; /** * * @param columnName * @param keyMapper * @return * @throws E */ DataSet groupBy(String columnName, Try.Function keyMapper) throws E; /** * * @param columnName * @param keyMapper * @param aggregateResultColumnName * @param aggregateOnColumnName * @param collector * @return * @throws E */ DataSet groupBy(String columnName, Try.Function keyMapper, String aggregateResultColumnName, String aggregateOnColumnName, Collector collector) throws E; /** * * @param columnName * @param keyMapper * @param aggregateResultColumnName * @param aggregateOnColumnName * @param func * @return * @throws E * @throws E2 */ DataSet groupBy(String columnName, Try.Function keyMapper, String aggregateResultColumnName, String aggregateOnColumnName, Try.Function, ?, E2> func) throws E, E2; /** * * @param columnName * @param keyMapper * @param aggregateResultColumnName * @param aggregateOnColumnNames * @param collector * @return * @throws E */ DataSet groupBy(String columnName, Try.Function keyMapper, String aggregateResultColumnName, Collection aggregateOnColumnNames, Collector collector) throws E; /** * * @param columnName * @param keyMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @param aggregateResultColumnName * @param aggregateOnColumnNames * @param rowMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @param collector * @return * @throws E * @throws E2 */ DataSet groupBy(String columnName, Try.Function keyMapper, String aggregateResultColumnName, Collection aggregateOnColumnNames, Try.Function rowMapper, Collector collector) throws E, E2; /** * * @param columnNames * @return */ DataSet groupBy(Collection columnNames); /** * * @param columnNames * @param aggregateResultColumnName * @param aggregateOnColumnName * @param collector * @return */ DataSet groupBy(Collection columnNames, String aggregateResultColumnName, String aggregateOnColumnName, Collector collector); /** * * @param columnNames * @param aggregateResultColumnName * @param aggregateOnColumnName * @param func * @return * @throws E */ DataSet groupBy(Collection columnNames, String aggregateResultColumnName, String aggregateOnColumnName, Try.Function, ?, E> func) throws E; /** * * @param columnNames * @param aggregateResultColumnName * @param aggregateOnColumnNames * @param collector * @return */ DataSet groupBy(Collection columnNames, String aggregateResultColumnName, Collection aggregateOnColumnNames, Collector collector); /** * * @param columnNames * @param aggregateResultColumnName * @param aggregateOnColumnNames * @param rowMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @param collector * @return * @throws E */ DataSet groupBy(Collection columnNames, String aggregateResultColumnName, Collection aggregateOnColumnNames, Try.Function rowMapper, Collector collector) throws E; /** * * @param columnNames * @param keyMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @return * @throws E */ DataSet groupBy(Collection columnNames, Try.Function keyMapper) throws E; /** * * @param columnNames * @param keyMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @param aggregateResultColumnName * @param aggregateOnColumnName * @param collector * @return * @throws E */ DataSet groupBy(Collection columnNames, Try.Function keyMapper, String aggregateResultColumnName, String aggregateOnColumnName, Collector collector) throws E; /** * * @param columnNames * @param keyMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @param aggregateResultColumnName * @param aggregateOnColumnName * @param func * @return * @throws E * @throws E2 */ DataSet groupBy(Collection columnNames, Try.Function keyMapper, String aggregateResultColumnName, String aggregateOnColumnName, Try.Function, ?, E2> func) throws E, E2; /** * * @param columnNames * @param keyMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @param aggregateResultColumnName * @param aggregateOnColumnNames * @param collector * @return * @throws E */ DataSet groupBy(Collection columnNames, Try.Function keyMapper, String aggregateResultColumnName, Collection aggregateOnColumnNames, Collector collector) throws E; /** * * @param columnNames * @param keyMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @param aggregateResultColumnName * @param aggregateOnColumnNames * @param rowMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @param collector * @return * @throws E * @throws E2 */ DataSet groupBy(Collection columnNames, Try.Function keyMapper, String aggregateResultColumnName, Collection aggregateOnColumnNames, Try.Function rowMapper, Collector collector) throws E, E2; /** * * @param columnNames * @return */ Stream rollup(Collection columnNames); /** * * @param columnNames * @param aggregateResultColumnName * @param aggregateOnColumnName * @param collector * @return */ Stream rollup(Collection columnNames, String aggregateResultColumnName, String aggregateOnColumnName, Collector collector); /** * * @param columnNames * @param aggregateResultColumnName * @param aggregateOnColumnName * @param func * @return */ Stream rollup(Collection columnNames, String aggregateResultColumnName, String aggregateOnColumnName, Try.Function, ?, E> func); /** * * @param columnNames * @param aggregateResultColumnName * @param aggregateOnColumnNames * @param collector * @return */ Stream rollup(Collection columnNames, String aggregateResultColumnName, Collection aggregateOnColumnNames, Collector collector); /** * * @param columnNames * @param aggregateResultColumnName * @param aggregateOnColumnNames * @param rowMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @param collector * @return */ Stream rollup(Collection columnNames, String aggregateResultColumnName, Collection aggregateOnColumnNames, Try.Function rowMapper, Collector collector); /** * * @param columnNames * @param keyMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @return */ Stream rollup(Collection columnNames, Try.Function keyMapper); /** * * @param columnNames * @param keyMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @param aggregateResultColumnName * @param aggregateOnColumnName * @param collector * @return */ Stream rollup(Collection columnNames, Try.Function keyMapper, String aggregateResultColumnName, String aggregateOnColumnName, Collector collector); /** * * @param columnNames * @param keyMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @param aggregateResultColumnName * @param aggregateOnColumnName * @param func * @return */ Stream rollup(Collection columnNames, Try.Function keyMapper, String aggregateResultColumnName, String aggregateOnColumnName, Try.Function, ?, E2> func); /** * * @param columnNames * @param keyMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @param aggregateResultColumnName * @param aggregateOnColumnNames * @param collector * @return */ Stream rollup(Collection columnNames, Try.Function keyMapper, String aggregateResultColumnName, Collection aggregateOnColumnNames, Collector collector); /** * * @param columnNames * @param keyMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @param aggregateResultColumnName * @param aggregateOnColumnNames * @param rowMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @param collector * @return */ Stream rollup(Collection columnNames, Try.Function keyMapper, String aggregateResultColumnName, Collection aggregateOnColumnNames, Try.Function rowMapper, Collector collector); /** * * @param columnNames * @return */ Stream cube(Collection columnNames); /** * * @param columnNames * @param aggregateResultColumnName * @param aggregateOnColumnName * @param collector * @return */ Stream cube(Collection columnNames, String aggregateResultColumnName, String aggregateOnColumnName, Collector collector); /** * * @param columnNames * @param aggregateResultColumnName * @param aggregateOnColumnName * @param func * @return */ Stream cube(Collection columnNames, String aggregateResultColumnName, String aggregateOnColumnName, Try.Function, ?, E> func); /** * * @param columnNames * @param aggregateResultColumnName * @param aggregateOnColumnNames * @param collector * @return */ Stream cube(Collection columnNames, String aggregateResultColumnName, Collection aggregateOnColumnNames, Collector collector); /** * * @param columnNames * @param aggregateResultColumnName * @param aggregateOnColumnNames * @param rowMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @param collector * @return */ Stream cube(Collection columnNames, String aggregateResultColumnName, Collection aggregateOnColumnNames, Try.Function rowMapper, Collector collector); /** * * @param columnNames * @param keyMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @return */ Stream cube(Collection columnNames, Try.Function keyMapper); /** * * @param columnNames * @param keyMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @param aggregateResultColumnName * @param aggregateOnColumnName * @param collector * @return */ Stream cube(Collection columnNames, Try.Function keyMapper, String aggregateResultColumnName, String aggregateOnColumnName, Collector collector); /** * * @param columnNames * @param keyMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @param aggregateResultColumnName * @param aggregateOnColumnName * @param func * @return */ Stream cube(Collection columnNames, Try.Function keyMapper, String aggregateResultColumnName, String aggregateOnColumnName, Try.Function, ?, E2> func); /** * * @param columnNames * @param keyMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @param aggregateResultColumnName * @param aggregateOnColumnNames * @param collector * @return */ Stream cube(Collection columnNames, Try.Function keyMapper, String aggregateResultColumnName, Collection aggregateOnColumnNames, Collector collector); /** * * @param columnNames * @param keyMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @param aggregateResultColumnName * @param aggregateOnColumnNames * @param rowMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @param collector * @return */ Stream cube(Collection columnNames, Try.Function keyMapper, String aggregateResultColumnName, Collection aggregateOnColumnNames, Try.Function rowMapper, Collector collector); /** * * @param columnName */ void sortBy(String columnName); /** * * @param columnName * @param cmp */ void sortBy(String columnName, Comparator cmp); /** * * @param columnNames */ void sortBy(Collection columnNames); /** * * @param columnNames * @param cmp */ void sortBy(Collection columnNames, Comparator cmp); /** * * @param columnNames * @param keyMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) */ @SuppressWarnings("rawtypes") void sortBy(Collection columnNames, Function keyMapper); /** * * @param columnName */ void parallelSortBy(String columnName); /** * * @param columnName * @param cmp */ void parallelSortBy(String columnName, Comparator cmp); /** * * @param columnNames */ void parallelSortBy(Collection columnNames); /** * * @param columnNames * @param cmp */ void parallelSortBy(Collection columnNames, Comparator cmp); /** * * @param columnNames * @param keyMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) */ @SuppressWarnings("rawtypes") void parallelSortBy(Collection columnNames, Function keyMapper); /** * * @param columnName * @param n * @return */ DataSet topBy(String columnName, int n); /** * * @param columnName * @param n * @param cmp * @return */ DataSet topBy(String columnName, int n, Comparator cmp); /** * * @param columnNames * @param n * @return */ DataSet topBy(Collection columnNames, int n); /** * * @param columnNames * @param n * @param cmp * @return */ DataSet topBy(Collection columnNames, int n, Comparator cmp); /** * * @param columnNames * @param n * @param keyMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @return */ @SuppressWarnings("rawtypes") DataSet topBy(Collection columnNames, int n, Function keyMapper); /** * Returns a new DataSet with the rows de-duplicated by the values in all columns * * @return a new DataSet */ DataSet distinct(); /** * Returns a new DataSet with the rows de-duplicated by the value in the specified column * * @param columnName * @return a new DataSet */ DataSet distinctBy(String columnName); /** * Returns a new DataSet with the rows de-duplicated by the value in the specified column from the specified fromRowIndex to toRowIndex * * @param columnName * @param keyMapper don't change value of the input parameter. * @return */ DataSet distinctBy(String columnName, Try.Function keyMapper) throws E; /** * Returns a new DataSet with the rows de-duplicated by the values in the specified columns * * @param columnNames * @return a new DataSet */ DataSet distinctBy(Collection columnNames); /** * Returns a new DataSet with the rows de-duplicated by the values in the specified columns from the specified fromRowIndex to toRowIndex * * @param columnNames * @param fromRowIndex * @param toRowIndex * @param keyMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @return */ DataSet distinctBy(Collection columnNames, Try.Function keyMapper) throws E; /** * * @param filter DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @return */ DataSet filter(Try.Predicate filter) throws E; /** * * @param filter DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @param max * @return */ DataSet filter(Try.Predicate filter, int max) throws E; /** * * @param fromRowIndex * @param toRowIndex * @param filter DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @return */ DataSet filter(int fromRowIndex, int toRowIndex, Try.Predicate filter) throws E; /** * * @param fromRowIndex * @param toRowIndex * @param filter DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @param max * @return */ DataSet filter(int fromRowIndex, int toRowIndex, Try.Predicate filter, int max) throws E; /** * * @param filter * @return */ DataSet filter(Tuple2 columnNames, Try.BiPredicate filter) throws E; /** * * @param filter * @param max * @return */ DataSet filter(Tuple2 columnNames, Try.BiPredicate filter, int max) throws E; /** * * @param fromRowIndex * @param toRowIndex * @param filter * @return */ DataSet filter(Tuple2 columnNames, int fromRowIndex, int toRowIndex, Try.BiPredicate filter) throws E; /** * * @param fromRowIndex * @param toRowIndex * @param filter * @param max * @return */ DataSet filter(Tuple2 columnNames, int fromRowIndex, int toRowIndex, Try.BiPredicate filter, int max) throws E; /** * * @param filter * @return */ DataSet filter(Tuple3 columnNames, Try.TriPredicate filter) throws E; /** * * @param filter * @param max * @return */ DataSet filter(Tuple3 columnNames, Try.TriPredicate filter, int max) throws E; /** * * @param fromRowIndex * @param toRowIndex * @param filter * @return */ DataSet filter(Tuple3 columnNames, int fromRowIndex, int toRowIndex, Try.TriPredicate filter) throws E; /** * * @param fromRowIndex * @param toRowIndex * @param filter * @param max * @return */ DataSet filter(Tuple3 columnNames, int fromRowIndex, int toRowIndex, Try.TriPredicate filter, int max) throws E; /** * * @param columnName * @param filter * @return */ DataSet filter(String columnName, Try.Predicate filter) throws E; /** * * @param columnName * @param filter * @param max * @return */ DataSet filter(String columnName, Try.Predicate filter, int max) throws E; /** * * @param columnName * @param fromRowIndex * @param toRowIndex * @param filter * @return */ DataSet filter(String columnName, int fromRowIndex, int toRowIndex, Try.Predicate filter) throws E; /** * * @param columnName * @param fromRowIndex * @param toRowIndex * @param filter * @param max * @return */ DataSet filter(String columnName, int fromRowIndex, int toRowIndex, Try.Predicate filter, int max) throws E; /** * * @param columnNames * @param filter DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @return */ DataSet filter(Collection columnNames, Try.Predicate filter) throws E; /** * * @param columnNames * @param filter DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @param max * @return */ DataSet filter(Collection columnNames, Try.Predicate filter, int max) throws E; /** * * @param columnNames * @param fromRowIndex * @param toRowIndex * @param filter DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @return */ DataSet filter(Collection columnNames, int fromRowIndex, int toRowIndex, Try.Predicate filter) throws E; /** * * @param columnNames * @param fromRowIndex * @param toRowIndex * @param filter DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @param max * @return */ DataSet filter(Collection columnNames, int fromRowIndex, int toRowIndex, Try.Predicate filter, int max) throws E; /** * * @param fromColumnName * @param func * @param newColumnName * @param copyingColumnName * @return * @throws E */ DataSet map(String fromColumnName, Try.Function func, String newColumnName, String copyingColumnName) throws E; /** * * @param fromColumnName * @param func * @param newColumnName * @param copyingColumnNames * @return * @throws E */ DataSet map(String fromColumnName, Try.Function func, String newColumnName, Collection copyingColumnNames) throws E; /** * * @param fromColumnNames * @param func * @param newColumnName * @param copyingColumnNames * @return * @throws E */ DataSet map(Tuple2 fromColumnNames, Try.BiFunction func, String newColumnName, Collection copyingColumnNames) throws E; /** * * @param fromColumnNames * @param func * @param newColumnName * @param copyingColumnNames * @return * @throws E */ DataSet map(Tuple3 fromColumnNames, Try.TriFunction func, String newColumnName, Collection copyingColumnNames) throws E; /** * * @param fromColumnNames * @param func DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @param newColumnName * @param copyingColumnNames * @return * @throws E */ DataSet map(Collection fromColumnNames, Try.Function func, String newColumnName, Collection copyingColumnNames) throws E; /** * * @param fromColumnName * @param func * @param newColumnName * @param copyingColumnName * @return * @throws E */ DataSet flatMap(String fromColumnName, Try.Function, E> func, String newColumnName, String copyingColumnName) throws E; /** * * @param fromColumnName * @param func * @param newColumnName * @param copyingColumnNames * @return * @throws E */ DataSet flatMap(String fromColumnName, Try.Function, E> func, String newColumnName, Collection copyingColumnNames) throws E; /** * * @param fromColumnNames * @param func * @param newColumnName * @param copyingColumnNames * @return * @throws E */ DataSet flatMap(Tuple2 fromColumnNames, Try.BiFunction, E> func, String newColumnName, Collection copyingColumnNames) throws E; /** * * @param fromColumnNames * @param func * @param newColumnName * @param copyingColumnNames * @return * @throws E */ DataSet flatMap(Tuple3 fromColumnNames, Try.TriFunction, E> func, String newColumnName, Collection copyingColumnNames) throws E; /** * * @param fromColumnNames * @param func DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @param newColumnName * @param copyingColumnNames * @return * @throws E */ DataSet flatMap(Collection fromColumnNames, Try.Function, E> func, String newColumnName, Collection copyingColumnNames) throws E; /** * Returns a new DataSet that is limited to the rows where there is a match in both this DataSet and right DataSet. * * @param right * @param columnName * @param refColumnName * @return a new DataSet */ DataSet innerJoin(DataSet right, String columnName, String refColumnName); /** * Returns a new DataSet that is limited to the rows where there is a match in both this DataSet and right DataSet. * * @param right * @param onColumnNames * @return a new DataSet */ DataSet innerJoin(DataSet right, Map onColumnNames); /** * Returns a new DataSet that is limited to the rows where there is a match in both this DataSet and right DataSet. * * @param right * @param onColumnNames * @param newColumnName * @param newColumnClass it can be Object[]/List/Set/Map/Entity * @return a new DataSet */ DataSet innerJoin(DataSet right, Map onColumnNames, String newColumnName, Class newColumnClass); /** * Returns a new DataSet that is limited to the rows where there is a match in both this DataSet and right DataSet. * * @param right * @param onColumnNames * @param newColumnName * @param newColumnClass it can be Object[]/List/Set/Map/Entity * @param collSupplier it's for one-to-many join * @return a new DataSet */ @SuppressWarnings("rawtypes") DataSet innerJoin(DataSet right, Map onColumnNames, String newColumnName, Class newColumnClass, IntFunction collSupplier); /** * Returns a new DataSet that has all the rows from this DataSet and the rows from the specified right DataSet if they have a match with the rows from the this DataSet. * * @param right * @param columnName * @param refColumnName * @return a new DataSet */ DataSet leftJoin(DataSet right, String columnName, String refColumnName); /** * Returns a new DataSet that has all the rows from this DataSet and the rows from the specified right DataSet if they have a match with the rows from the this DataSet. * * @param right * @param onColumnNames * @return a new DataSet */ DataSet leftJoin(DataSet right, Map onColumnNames); /** * Returns a new DataSet that has all the rows from this DataSet and the rows from the specified right DataSet if they have a match with the rows from the this DataSet. * * @param right * @param onColumnNames * @param newColumnName * @param newColumnClass it can be Object[]/List/Set/Map/Entity * @return a new DataSet */ DataSet leftJoin(DataSet right, Map onColumnNames, String newColumnName, Class newColumnClass); /** * Returns a new DataSet that has all the rows from this DataSet and the rows from the specified right DataSet if they have a match with the rows from the this DataSet. * * @param right * @param onColumnNames * @param newColumnName * @param newColumnClass it can be Object[]/List/Set/Map/Entity * @param collSupplier it's for one-to-many join * @return a new DataSet */ @SuppressWarnings("rawtypes") DataSet leftJoin(DataSet right, Map onColumnNames, String newColumnName, Class newColumnClass, IntFunction collSupplier); /** * Returns a new DataSet that has all the rows from the specified right DataSet and the rows from this DataSet if they have a match with the rows from the right DataSet. * * @param right * @param columnName * @param refColumnName * @return a new DataSet */ DataSet rightJoin(DataSet right, String columnName, String refColumnName); /** * Returns a new DataSet that has all the rows from the specified right DataSet and the rows from this DataSet if they have a match with the rows from the right DataSet. * * @param right * @param onColumnNames * @return a new DataSet */ DataSet rightJoin(DataSet right, Map onColumnNames); /** * Returns a new DataSet that has all the rows from the specified right DataSet and the rows from this DataSet if they have a match with the rows from the right DataSet. * * @param right * @param onColumnNames * @param newColumnName * @param newColumnClass it can be Object[]/List/Set/Map/Entity * @return a new DataSet */ DataSet rightJoin(DataSet right, Map onColumnNames, String newColumnName, Class newColumnClass); /** * Returns a new DataSet that has all the rows from the specified right DataSet and the rows from this DataSet if they have a match with the rows from the right DataSet. * * @param right * @param onColumnNames * @param newColumnName * @param newColumnClass it can be Object[]/List/Set/Map/Entity * @param collSupplier it's for one-to-many join * @return a new DataSet */ @SuppressWarnings("rawtypes") DataSet rightJoin(DataSet right, Map onColumnNames, String newColumnName, Class newColumnClass, IntFunction collSupplier); /** * Returns a new DataSet that has all the rows from this DataSet and the specified right DataSet, regardless of whether there are any matches. * * @param right * @param columnName * @param refColumnName * @return a new DataSet */ DataSet fullJoin(DataSet right, String columnName, String refColumnName); /** * Returns a new DataSet that has all the rows from this DataSet and the specified right DataSet, regardless of whether there are any matches. * * @param right * @param onColumnNames * @return a new DataSet */ DataSet fullJoin(DataSet right, Map onColumnNames); /** * Returns a new DataSet that has all the rows from this DataSet and the specified right DataSet, regardless of whether there are any matches. * * @param right * @param onColumnNames * @param newColumnName * @param newColumnClass it can be Object[]/List/Set/Map/Entity * @return a new DataSet */ DataSet fullJoin(DataSet right, Map onColumnNames, String newColumnName, Class newColumnClass); /** * Returns a new DataSet that has all the rows from this DataSet and the specified right DataSet, regardless of whether there are any matches. * * @param right * @param onColumnNames * @param newColumnName * @param newColumnClass it can be Object[]/List/Set/Map/Entity * @param collSupplier it's for one-to-many join * @return a new DataSet */ @SuppressWarnings("rawtypes") DataSet fullJoin(DataSet right, Map onColumnNames, String newColumnName, Class newColumnClass, IntFunction collSupplier); /** * Returns a new DataSet. Duplicated row in the specified {@code DataSet} will be eliminated. * * @param dataSet * @return a new DataSet */ DataSet union(DataSet dataSet); /** * Returns a new DataSet. Duplicated row in the specified {@code DataSet} will not be eliminated. * * @param dataSet * @return a new DataSet */ DataSet unionAll(DataSet dataSet); /** * Returns a new {@code DataSet} with all rows from this DataSet and which also appear in the specified {@code other} in common columns. * This operation doesn't remove duplicate rows from the final result set. * * @param other * @return * @see java.util.Collection#retainAll(Collection) */ DataSet intersectAll(DataSet other); /** * Returns a new {@code DataSet} with all rows from this DataSet and which not appear in the specified {@code other} in common columns. * * @param other * @return * @see java.util.Collection#removeAll(Collection) */ DataSet except(DataSet other); /** * Returns a new DataSet. * * @param dataSet * @return a new DataSet * @see com.landawn.abacus.util.IntList#difference(com.landawn.abacus.util.IntList) */ DataSet difference(DataSet dataSet); /** * * @param dataSet * @return * @see com.landawn.abacus.util.IntList#symmetricDifference(com.landawn.abacus.util.IntList) */ DataSet symmetricDifference(DataSet dataSet); /** * Returns a new DataSet. * * @param dataSet * @return a new DataSet * @see com.landawn.abacus.util.IntList#intersection(com.landawn.abacus.util.IntList) */ DataSet intersection(DataSet dataSet); /** * Returns a new DataSet by appending the specified from DataSet into this DataSet. * * @param from */ DataSet merge(DataSet from); /** * Returns a new DataSet by appending the specified from DataSet into this DataSet. * * @param from * @param columnNames */ DataSet merge(DataSet from, Collection columnNames); /** * Returns a new DataSet by appending the specified from DataSet from fromRowIndex to toRowIndex into this DataSet. * * @param from * @param fromRowIndex * @param toRowIndex */ DataSet merge(DataSet from, int fromRowIndex, int toRowIndex); /** * Returns a new DataSet by appending the specified columnNames in from DataSet from fromRowIndex to toRowIndex into this DataSet. * * @param from * @param columnNames * @param fromRowIndex * @param toRowIndex */ DataSet merge(DataSet from, Collection columnNames, int fromRowIndex, int toRowIndex); /** * * @param b * @return */ DataSet cartesianProduct(DataSet b); /** * Returns consecutive sub lists of this DataSet, each of the same chunkSize (the list may be smaller), or an empty List if this DataSet is empty. * * @param chunkSize the desired size of each sub DataSet (the last may be smaller). * @return */ Stream split(int chunkSize); /** * Returns consecutive sub lists of this DataSet, each of the same chunkSize (the list may be smaller), or an empty List if this DataSet is empty. * * @param columnNames * @param chunkSize the desired size of each sub DataSet (the last may be smaller). * @return */ Stream split(Collection columnNames, int chunkSize); /** * Returns consecutive sub lists of this DataSet, each of the same chunkSize (the list may be smaller), or an empty List if this DataSet is empty. * * @param chunkSize * @return */ List splitt(int chunkSize); /** * Returns consecutive sub lists of this DataSet, each of the same chunkSize (the list may be smaller), or an empty List if this DataSet is empty. * * @param size * @param columnNames * @return */ List splitt(Collection columnNames, int chunkSize); /** * Returns a frozen {@code DataSet} * * @param columnNames * @return a copy of this DataSet * @see List#subList(int, int). */ DataSet slice(Collection columnNames); /** * Returns a frozen {@code DataSet} * * @param fromRowIndex * @param toRowIndex * @return a copy of this DataSet * @see List#subList(int, int). */ DataSet slice(int fromRowIndex, int toRowIndex); /** * Returns a frozen {@code DataSet} * * @param columnNames * @param fromRowIndex * @param toRowIndex * @return a copy of this DataSet * @see List#subList(int, int). */ DataSet slice(Collection columnNames, int fromRowIndex, int toRowIndex); /** * Returns the copy of this DataSet. * The frozen status of the copy will always be false, even the original DataSet is frozen. * * @return a copy of this DataSet */ DataSet copy(); /** * Returns the copy of this DataSet with specified column name list. * The frozen status of the copy will always be false, even the original DataSet is frozen. * * @param columnNames * @return a copy of this DataSet */ DataSet copy(Collection columnNames); /** * Returns the copy of this DataSet from the specified fromRowIndex to toRowIndex. * The frozen status of the copy will always be false, even the original DataSet is frozen. * * @param fromRowIndex * @param toRowIndex * @return a copy of this DataSet */ DataSet copy(int fromRowIndex, int toRowIndex); /** * Returns the copy of this DataSet with specified column name list from the specified fromRowIndex to toRowIndex. * The frozen status of the copy will always be false, even the original DataSet is frozen. * * @param columnNames * @param fromRowIndex * @param toRowIndex * @return a copy of this DataSet */ DataSet copy(Collection columnNames, int fromRowIndex, int toRowIndex); /** * Deeply copy each element in this DataSet by Serialization/Deserialization. * * @return */ DataSet clone(); /** * Deeply copy each element in this DataSet by Serialization/Deserialization. * * @return */ DataSet clone(boolean freeze); BiIterator iterator(String columnNameA, String columnNameB); BiIterator iterator(String columnNameA, String columnNameB, int fromRowIndex, int toRowIndex); TriIterator iterator(String columnNameA, String columnNameB, String columnNameC); TriIterator iterator(String columnNameA, String columnNameB, String columnNameC, int fromRowIndex, int toRowIndex); /** * Method paginate. * * @param pageSize * @return */ PaginatedDataSet paginate(int pageSize); /** * * @param columnName * @return */ Stream stream(String columnName); /** * * @param columnName * @param fromRowIndex * @param toRowIndex * @return */ Stream stream(String columnName, int fromRowIndex, int toRowIndex); /** * @param rowMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * * @return */ Stream stream(Function rowMapper); /** * * @param fromRowIndex * @param toRowIndex * @param rowMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @return */ Stream stream(int fromRowIndex, int toRowIndex, Function rowMapper); /** * * @param columnNames * @param rowMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @return */ Stream stream(Collection columnNames, Function rowMapper); /** * * @param columnNames * @param fromRowIndex * @param toRowIndex * @param rowMapper DON't cache or update the input parameter {@code DisposableObjArray} or its values(Array) * @return */ Stream stream(Collection columnNames, int fromRowIndex, int toRowIndex, Function rowMapper); /** * * @param rowClass it can be Object[]/List/Set/Map/Entity * @return */ Stream stream(Class rowClass); /** * * @param rowClass it can be Object[]/List/Set/Map/Entity * @param fromRowIndex * @param toRowIndex * @return */ Stream stream(Class rowClass, int fromRowIndex, int toRowIndex); /** * * @param rowClass it can be Object[]/List/Set/Map/Entity * @param fromRowIndex * @param toRowIndex * @return */ Stream stream(Class rowClass, Collection columnNames); /** * * @param rowClass it can be Object[]/List/Set/Map/Entity * @param fromRowIndex * @param toRowIndex * @return */ Stream stream(Class rowClass, Collection columnNames, int fromRowIndex, int toRowIndex); /** * * @param rowSupplier it can be Object[]/List/Set/Map/Entity * @return */ Stream stream(IntFunction rowSupplier); /** * * @param rowSupplier it can be Object[]/List/Set/Map/Entity * @param fromRowIndex * @param toRowIndex * @return */ Stream stream(IntFunction rowSupplier, int fromRowIndex, int toRowIndex); /** * * @param rowSupplier it can be Object[]/List/Set/Map/Entity * @param fromRowIndex * @param toRowIndex * @return */ Stream stream(IntFunction rowSupplier, Collection columnNames); /** * * @param rowSupplier it can be Object[]/List/Set/Map/Entity * @param fromRowIndex * @param toRowIndex * @return */ Stream stream(IntFunction rowSupplier, Collection columnNames, int fromRowIndex, int toRowIndex); R apply(Try.Function func) throws E; void accept(Try.Consumer action) throws E; /** * Method freeze */ void freeze(); /** * Method frozen * * @return */ boolean frozen(); /** * Method clear. */ void clear(); /** * * @return */ boolean isEmpty(); /** * */ void trimToSize(); /** * Returns the size of this {@code DataSet}. * * @return */ int size(); /** * * @return */ Properties properties(); Stream columnNames(); Stream> columns(); /** * * @return key are column name, value is column - an immutable list, backed by the column in this {@code DataSet}. */ Map> columnMap(); Sheet toSheet(); // DataSetBuilder builder(); void println() throws UncheckedIOException; void println(Collection columnNames, int fromRowIndex, int toRowIndex) throws UncheckedIOException; /** * * @param outputWriter * @return the specified {@code outputWriter} * @throws UncheckedIOException */ W println(W outputWriter) throws UncheckedIOException; /** * * @param outputWriter * @param columnNames * @param fromRowIndex * @param toRowIndex * @return the specified {@code outputWriter} * @throws UncheckedIOException */ W println(W outputWriter, Collection columnNames, int fromRowIndex, int toRowIndex) throws UncheckedIOException; }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy