Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.landawn.abacus.DataSet Maven / Gradle / Ivy
/*
* 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.util.ListMultimap;
import com.landawn.abacus.util.Multimap;
import com.landawn.abacus.util.Multiset;
import com.landawn.abacus.util.NullabLe;
import com.landawn.abacus.util.Optional;
import com.landawn.abacus.util.OptionalDouble;
import com.landawn.abacus.util.Properties;
import com.landawn.abacus.util.Sheet;
import com.landawn.abacus.util.function.BiFunction;
import com.landawn.abacus.util.function.BiPredicate;
import com.landawn.abacus.util.function.Consumer;
import com.landawn.abacus.util.function.Function;
import com.landawn.abacus.util.function.IntFunction;
import com.landawn.abacus.util.function.Predicate;
import com.landawn.abacus.util.function.ToDoubleFunction;
import com.landawn.abacus.util.function.ToIntFunction;
import com.landawn.abacus.util.function.ToLongFunction;
import com.landawn.abacus.util.stream.Collector;
import com.landawn.abacus.util.stream.Stream;
/**
* Uses IntFunction rowSupplier
to identity row for generic types.
*
* @since 0.8
*
* @author Haiyang Li
*/
public interface DataSet extends Iterable {
// /**
// * 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.
*/
List columnNameList();
/**
* Return the column name list filtered by specified filter
.
*
* @param filter
*/
List columnNames(Predicate filter);
/**
* 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[] getColumnIndex(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 containsColumnAll(Collection columnNames);
/**
*
* @param columnName
* @param newColumnName
*/
void renameColumn(String columnName, String newColumnName);
/**
*
* @param oldNewNames
*/
void renameColumn(Map oldNewNames);
/**
*
* @param columnName
* @param func
*/
void renameColumn(String columnName, Function func);
/**
*
* @param columnNames
* @param func
*/
void renameColumn(Collection columnNames, Function func);
void moveColumn(String columnName, int newPosition);
void moveColumn(Map columnNameNewPositionMap);
/**
* Swap the positions of the two specified columns.
*
* @param columnNameA
* @param columnNameB
*/
void swapColumn(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 swapRow(int rowIndexA, int rowIndexB);
/**
*
* @param rowIndex
* @param columnIndex
* @return
*/
T get(int rowIndex, int columnIndex);
/**
* @param targetClass
* @param rowIndex
* @param columnIndex
* @return
*/
T get(Class targetClass, 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);
/**
*
* @param columnIndex
* @return
*/
T get(int columnIndex);
/**
*
* @param targetClass
* @param columnIndex
* @return
*/
T get(Class targetClass, int columnIndex);
/**
*
* @param columnName
* @return
*/
T get(String columnName);
/**
*
* @param targetClass
* @param columnName
* @return
*/
T get(Class targetClass, String columnName);
/**
* Return default value (false) if the property is null.
*
* @param columnIndex
* @return
*/
boolean getBoolean(int columnIndex);
/**
* Return default value (false) if the property is null.
*
* @param columnName
* @return
*/
boolean getBoolean(String columnName);
/**
* Return default value (0) if the property is null.
*
* @param columnIndex
* @return
*/
char getChar(int columnIndex);
/**
* Return default value (0) if the property is null.
*
* @param columnName
* @return
*/
char getChar(String columnName);
/**
* Return default value (0) if the property is null. Return Number.byteValue() otherwise.
*
* @param columnIndex
* @return
*/
byte getByte(int columnIndex);
/**
* Return default value (0) if the property is null. Return Number.byteValue() otherwise.
*
* @param columnName
* @return
*/
byte getByte(String columnName);
/**
* Return default value (0) if the property is null. Return Number.shortValue() otherwise.
*
* @param columnIndex
* @return
*/
short getShort(int columnIndex);
/**
* Return default value (0) if the property is null. Return Number.shortValue() otherwise.
*
* @param columnName
* @return
*/
short getShort(String columnName);
/**
* Return default value (0) if the property is null. Return Number.intValue() otherwise.
*
* @param columnIndex
* @return
*/
int getInt(int columnIndex);
/**
* Return default value (0) if the property is null. Return Number.intValue() otherwise.
*
* @param columnName
* @return
*/
int getInt(String columnName);
/**
* Return default value (0) if the property is null. Return Number.longValue() otherwise.
*
* @param columnIndex
* @return
*/
long getLong(int columnIndex);
/**
* Return default value (0) if the property is null. Return Number.longValue() otherwise.
*
* @param columnName
* @return
*/
long getLong(String columnName);
/**
* Return default value (0f) if the property is null. Return Number.floatValue() otherwise.
*
* @param columnIndex
* @return
*/
float getFloat(int columnIndex);
/**
* Return default value (0f) if the property is null. Return Number.floatValue() otherwise.
*
* @param columnName
* @return
*/
float getFloat(String columnName);
/**
* Return default value (0d) if the property is null. Return Number.doubleValue() otherwise.
*
* @param columnIndex
* @return
*/
double getDouble(int columnIndex);
/**
* Return default value (0d) if the property is null. Return Number.doubleValue() otherwise.
*
* @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
*/
List getColumn(int columnIndex);
/**
* Must NOT modify the returned list.
*
* @param columnName
* @return
*/
List getColumn(String columnName);
// /**
// * Must NOT modify the returned list.
// *
// * @param columnType it's only used to identify the type.
// * @param columnIndex
// * @return
// */
// List getColumn(Class extends T> columnType, int columnIndex);
//
// /**
// * Must NOT modify the returned list.
// *
// * @param columnType it's only used to identify the type.
// * @param columnName
// * @return
// */
// List getColumn(Class extends T> columnType, 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, Function, ?> func);
/**
* 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, Function, ?> func);
/**
* Generate the new column values from the specified columns by the specified Function
.
* @param newColumnName
* @param fromColumnNames
* @param func
*/
void addColumn(String newColumnName, Collection fromColumnNames, Function super Object[], ?> func);
/**
* 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, Collection fromColumnNames, Function super Object[], ?> func);
/**
* Remove the column with the specified columnName from this DataSet.
*
* @param columnName
*/
void removeColumn(String columnName);
/**
* Remove the column(s) with the specified columnNames from this DataSet.
*
* @param columnNames
*/
void removeColumnAll(Collection columnNames);
/**
* Update the values of the specified column by the specified function.
*
* @param columnName
* @param func
*/
void updateColumn(String columnName, Function, ?> func);
/**
* Update the values of the specified columns by the specified function.
*
* @param columnNames
* @param func
*/
void updateColumn(Collection columnNames, Function, ?> func);
/**
* 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 convertColumn(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/List/Set/Map/Entity
* @return
*/
void combineColumn(Collection columnNames, String newColumnName, Class> newColumnClass);
void combineColumn(Collection columnNames, String newColumnName, Function super Object[], ?> combineFunc);
void combineColumn(Predicate columnNameFilter, String newColumnName, Class> newColumnClass);
void combineColumn(Predicate columnNameFilter, String newColumnName, Function super Object[], ?> combineFunc);
void divideColumn(String columnName, Collection newColumnNames, Function, ? extends List>> divideFunc);
/**
*
* @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 removeRowAll(int... indices);
void updateRow(int rowIndex, Function, ?> func);
void updateRow(int[] indices, Function, ?> func);
void updateAll(Function, ?> func);
void replaceIf(Predicate> func, Object newValue);
/**
* 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/List/Set/Map/Entity
* @param rowNum
* @return
*/
T getRow(Class extends T> rowClass, int rowNum);
/**
*
* @param rowClass it can be Object[]/List/List/Set/Map/Entity
* @param columnNames
* @param rowNum
* @return
*/
T getRow(Class extends T> rowClass, Collection columnNames, int rowNum);
/**
*
* @param rowSupplier it can be Object[]/List/List/Set/Map/Entity
* @param rowNum
* @return
*/
T getRow(IntFunction extends T> rowSupplier, int rowNum);
/**
*
* @param rowSupplier it can be Object[]/List/List/Set/Map/Entity
* @param columnNames
* @param rowNum
* @return
*/
T getRow(IntFunction extends T> rowSupplier, Collection columnNames, int rowNum);
/**
*
* @return {@code Optional}
*/
Optional firstRow();
/**
*
* @param rowClass it can be Object[]/List/List/Set/Map/Entity
* @return {@code Optional}
*/
Optional firstRow(Class extends T> rowClass);
/**
*
* @param rowClass it can be Object[]/List/List/Set/Map/Entity
* @param columnNames
* @return {@code Optional}
*/
Optional firstRow(Class extends T> rowClass, Collection columnNames);
/**
*
* @param rowSupplier it can be Object[]/List/List/Set/Map/Entity
* @return {@code Optional}
*/
Optional firstRow(IntFunction extends T> rowSupplier);
/**
*
* @param rowSupplier it can be Object[]/List/List/Set/Map/Entity
* @param columnNames
* @return {@code Optional}
*/
Optional firstRow(IntFunction extends T> rowSupplier, Collection columnNames);
/**
*
* @return {@code Optional}
*/
Optional lastRow();
/**
*
* @param rowClass it can be Object[]/List/List/Set/Map/Entity
* @return {@code Optional}
*/
Optional lastRow(Class extends T> rowClass);
/**
*
* @param rowClass it can be Object[]/List/List/Set/Map/Entity
* which can be object array/list/set/map/entity.
* @param columnNames
* @return {@code Optional}
*/
Optional lastRow(Class extends T> rowClass, Collection columnNames);
/**
*
* @param rowSupplier it can be Object[]/List/List/Set/Map/Entity
* @return {@code Optional}
*/
Optional lastRow(IntFunction extends T> rowSupplier);
/**
*
* @param rowSupplier it can be Object[]/List/List/Set/Map/Entity
* @param columnNames
* @return {@code Optional}
*/
Optional lastRow(IntFunction extends T> rowSupplier, Collection columnNames);
// /**
// * It's for faster iteration without creating new row object for each row.
// *
// * @param output
// * which can be an instance of object array/list/set/map/entity.
// * @param rowNum
// */
// void row(Object output, int rowNum);
//
// /**
// * It's for faster iteration without creating new row object for each row.
// *
// * @param output
// * which can be an instance of object array/list/set/map/entity.
// * @param columnIndexes
// * @param rowNum
// */
// void row(Object output, int[] columnIndexes, int rowNum);
/**
* 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
*/
void forEach(Consumer super Object[]> action);
/**
* 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
* @param shareRowArray the same object array will be reset for each row during the iteration if it's true
.
* It can be set to true
to improve the performance if the action
only read each row object array once, don't modify it or save it in collection.
* The default value is false.
*/
void forEach(Consumer super Object[]> action, boolean shareRowArray);
/**
* 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
*/
void forEach(Collection columnNames, Consumer super Object[]> action);
/**
* 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
* @param shareRowArray the same object array will be reset for each row during the iteration if it's true
.
* It can be set to true
to improve the performance if the action
only read each row object array once, don't modify it or save it in collection.
* The default value is false.
*/
void forEach(Collection columnNames, Consumer super Object[]> action, boolean shareRowArray);
/**
* 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
*/
void forEach(int fromRowIndex, int toRowIndex, Consumer super Object[]> action);
/**
* 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
* @param shareRowArray the same object array will be reset for each row during the iteration if it's true
.
* It can be set to true
to improve the performance if the action
only read each row object array once, don't modify it or save it in collection.
* The default value is false.
*/
void forEach(int fromRowIndex, int toRowIndex, Consumer super Object[]> action, boolean shareRowArray);
/**
* 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
*/
void forEach(Collection columnNames, int fromRowIndex, int toRowIndex, Consumer super Object[]> action);
/**
* 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
* @param shareRowArray the same object array will be reset for each row during the iteration if it's true
.
* It can be set to true
to improve the performance if the action
only read each row object array once, don't modify it or save it in collection.
* The default value is false.
*/
void forEach(Collection columnNames, int fromRowIndex, int toRowIndex, Consumer super Object[]> action, boolean shareRowArray);
R forEach(R seed, BiFunction accumulator, BiPredicate super R, ? super Object[]> conditionToBreak);
R forEach(R seed, BiFunction accumulator, BiPredicate super R, ? super Object[]> conditionToBreak, boolean shareRowArray);
R forEach(Collection columnNames, R seed, BiFunction accumulator,
BiPredicate super R, ? super Object[]> conditionToBreak);
/**
* Execute accumulator
on each element till true
is returned by conditionToBreak
*
* @param columnNames
* @param seed The seed element is both the initial value of the reduction and the default result if there are no elements.
* @param accumulator
* @param conditionToBreak break if true
is return.
* @param shareRowArray
* @return
*/
R forEach(Collection columnNames, R seed, BiFunction accumulator,
BiPredicate super R, ? super Object[]> conditionToBreak, boolean shareRowArray);
R forEach(int fromRowIndex, int toRowIndex, R seed, BiFunction accumulator,
BiPredicate super R, ? super Object[]> conditionToBreak);
R forEach(int fromRowIndex, int toRowIndex, R seed, BiFunction accumulator,
BiPredicate super R, ? super Object[]> conditionToBreak, boolean shareRowArray);
R forEach(Collection columnNames, int fromRowIndex, int toRowIndex, R seed, BiFunction accumulator,
BiPredicate super R, ? super Object[]> conditionToBreak);
/**
* Execute accumulator
on each element till true
is returned by conditionToBreak
*
* @param columnNames
* @param fromRowIndex
* @param toRowIndex
* @param seed The seed element is both the initial value of the reduction and the default result if there are no elements.
* @param accumulator
* @param conditionToBreak break if true
is return.
* @param shareRowArray
* @return
*/
R forEach(Collection columnNames, int fromRowIndex, int toRowIndex, R seed, BiFunction accumulator,
BiPredicate super R, ? super Object[]> conditionToBreak, boolean shareRowArray);
/**
*
* @return
*/
Object[][] toArray();
/**
*
* @param fromRowIndex
* @param toRowIndex
* @return
*/
Object[][] toArray(int fromRowIndex, int toRowIndex);
/**
*
* @param rowClass it can be Object[]/List/List/Set/Map/Entity
* @return
*/
T[] toArray(Class extends T> rowClass);
/**
*
* @param rowClass it can be Object[]/List/List/Set/Map/Entity the class for the row value.
* @param fromRowIndex
* @param toRowIndex
* @return
*/
T[] toArray(Class extends T> rowClass, int fromRowIndex, int toRowIndex);
/**
*
* @param rowClass it can be Object[]/List/List/Set/Map/Entity the class for the row value.
* @param columnNames
* @param fromRowIndex
* @param toRowIndex
* @return
*/
T[] toArray(Class extends T> rowClass, Collection columnNames);
/**
*
* @param rowClass it can be Object[]/List/List/Set/Map/Entity the class for the row value.
* @param columnNames
* @param fromRowIndex
* @param toRowIndex
* @return
*/
T[] toArray(Class extends T> rowClass, Collection columnNames, int fromRowIndex, int toRowIndex);
/**
*
* @param rowSupplier it can be Object[]/List/List/Set/Map/Entity the class for the row value.
* @return
*/
T[] toArray(IntFunction extends T> rowSupplier);
/**
*
* @param rowSupplier it can be Object[]/List/List/Set/Map/Entity the class for the row value.
* @param fromRowIndex
* @param toRowIndex
* @return
*/
T[] toArray(IntFunction extends T> rowSupplier, int fromRowIndex, int toRowIndex);
/**
*
* @param rowSupplier it can be Object[]/List/List/Set/Map/Entity the class for the row value.
* @param columnNames
* @param fromRowIndex
* @param toRowIndex
* @return
*/
T[] toArray(IntFunction extends T> rowSupplier, Collection columnNames);
/**
*
* @param rowSupplier it can be Object[]/List/List/Set/Map/Entity the class for the row value.
* @param columnNames
* @param fromRowIndex
* @param toRowIndex
* @return
*/
T[] toArray(IntFunction extends T> rowSupplier, Collection columnNames, int fromRowIndex, int toRowIndex);
/**
*
* @return
*/
List toList();
/**
*
* @param fromRowIndex
* @param toRowIndex
* @return
*/
List toList(int fromRowIndex, int toRowIndex);
/**
*
* @param rowClass it can be Object[]/List/List/Set/Map/Entity
* @return
*/
List toList(Class extends T> rowClass);
/**
*
* @param rowClass it can be Object[]/List/List/Set/Map/Entity
* @param fromRowIndex
* @param toRowIndex
* @return
*/
List toList(Class extends T> rowClass, int fromRowIndex, int toRowIndex);
/**
*
* @param rowClass it can be Object[]/List/List/Set/Map/Entity
* @param fromRowIndex
* @param toRowIndex
* @return
*/
List toList(Class extends T> rowClass, Collection columnNames);
/**
*
* @param rowClass it can be Object[]/List/List/Set/Map/Entity
* @param fromRowIndex
* @param toRowIndex
* @return
*/
List toList(Class extends T> rowClass, Collection columnNames, int fromRowIndex, int toRowIndex);
/**
*
* @param rowSupplier it can be Object[]/List/List/Set/Map/Entity
* @return
*/
List toList(IntFunction extends T> rowSupplier);
/**
*
* @param rowSupplier it can be Object[]/List/List/Set/Map/Entity
* @param fromRowIndex
* @param toRowIndex
* @return
*/
List toList(IntFunction extends T> rowSupplier, int fromRowIndex, int toRowIndex);
/**
*
* @param rowSupplier it can be Object[]/List/List/Set/Map/Entity
* @param fromRowIndex
* @param toRowIndex
* @return
*/
List toList(IntFunction extends T> rowSupplier, Collection columnNames);
/**
*
* @param rowSupplier it can be Object[]/List/List/Set/Map/Entity
* @param fromRowIndex
* @param toRowIndex
* @return
*/
List toList(IntFunction extends T> 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/List/Set/Map/Entity
* @param keyColumnName
* @param valueColumnNames
* @return
*/
Map toMap(Class extends V> rowClass, String keyColumnName, Collection valueColumnNames);
/**
*
* @param rowClass it can be Object[]/List/List/Set/Map/Entity
* @param keyColumnName
* @param valueColumnNames
* @param fromRowIndex
* @param toRowIndex
* @return
*/
Map toMap(Class extends V> rowClass, String keyColumnName, Collection valueColumnNames, int fromRowIndex, int toRowIndex);
/**
*
* @param rowClass it can be Object[]/List/List/Set/Map/Entity
* @param keyColumnName
* @param valueColumnNames
* @param fromRowIndex
* @param toRowIndex
* @param supplier
* @return
*/
> M toMap(Class extends V> rowClass, String keyColumnName, Collection valueColumnNames, int fromRowIndex,
int toRowIndex, IntFunction supplier);
/**
*
* @param rowSupplier it can be Object[]/List/List/Set/Map/Entity
* @param keyColumnName
* @param valueColumnNames
* @return
*/
Map toMap(IntFunction extends V> rowSupplier, String keyColumnName, Collection valueColumnNames);
/**
*
* @param rowSupplier it can be Object[]/List/List/Set/Map/Entity
* @param keyColumnName
* @param valueColumnNames
* @param fromRowIndex
* @param toRowIndex
* @return
*/
Map toMap(IntFunction extends V> rowSupplier, String keyColumnName, Collection valueColumnNames, int fromRowIndex, int toRowIndex);
/**
*
* @param rowSupplier it can be Object[]/List/List/Set/Map/Entity
* @param keyColumnName
* @param valueColumnNames
* @param fromRowIndex
* @param toRowIndex
* @param supplier
* @return
*/
> M toMap(IntFunction extends V> 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/List/Set/Map/Entity
* @param keyColumnName
* @param valueColumnNames
* @return
*/
ListMultimap toMultimap(Class extends E> rowClass, String keyColumnName, Collection valueColumnNames);
/**
*
* @param rowClass it can be Object[]/List/List/Set/Map/Entity
* @param keyColumnName
* @param valueColumnNames
* @param fromRowIndex
* @param toRowIndex
* @return
*/
ListMultimap toMultimap(Class extends E> rowClass, String keyColumnName, Collection valueColumnNames, int fromRowIndex,
int toRowIndex);
/**
*
* @param rowClass it can be Object[]/List/List/Set/Map/Entity
* @param keyColumnName
* @param valueColumnNames
* @param fromRowIndex
* @param toRowIndex
* @param supplier
* @return
*/
, M extends Multimap> M toMultimap(Class extends E> rowClass, String keyColumnName,
Collection valueColumnNames, int fromRowIndex, int toRowIndex, IntFunction supplier);
/**
*
* @param rowSupplier it can be Object[]/List/List/Set/Map/Entity
* @param keyColumnName
* @param valueColumnNames
* @return
*/
ListMultimap toMultimap(IntFunction extends E> rowSupplier, String keyColumnName, Collection valueColumnNames);
/**
*
* @param rowSupplier it can be Object[]/List/List/Set/Map/Entity
* @param keyColumnName
* @param valueColumnNames
* @param fromRowIndex
* @param toRowIndex
* @return
*/
ListMultimap toMultimap(IntFunction extends E> rowSupplier, String keyColumnName, Collection valueColumnNames, int fromRowIndex,
int toRowIndex);
/**
*
* @param rowSupplier it can be Object[]/List/List/Set/Map/Entity
* @param keyColumnName
* @param valueColumnNames
* @param fromRowIndex
* @param toRowIndex
* @param supplier
* @return
*/
, M extends Multimap> M toMultimap(IntFunction extends E> rowSupplier, String keyColumnName,
Collection valueColumnNames, int fromRowIndex, int toRowIndex, IntFunction supplier);
/**
*
* @param columnName
* @return
*/
Multiset toMultiset(String columnName);
/**
*
* @param columnName
* @param fromRowIndex
* @param toRowIndex
* @return
*/
Multiset toMultiset(String columnName, int fromRowIndex, int toRowIndex);
/**
*
* @param columnName
* @param fromRowIndex
* @param toRowIndex
* @param supplier create Multiset
by new Multiset(ArrayHashMap.class)
or Multiset(LinkedArrayHashMap.class)
if the element is array.
* @return
*/
Multiset toMultiset(String columnName, int fromRowIndex, int toRowIndex, IntFunction> supplier);
/**
*
* @param rowClass it can be Object[]/List/List/Set/Map/Entity
* @param columnNames
* @return
*/
Multiset toMultiset(Class extends T> rowClass, Collection columnNames);
/**
*
* @param rowClass it can be Object[]/List/List/Set/Map/Entity
* @param columnNames
* @param fromRowIndex
* @param toRowIndex
* @return
*/
Multiset toMultiset(Class extends T> rowClass, Collection columnNames, int fromRowIndex, int toRowIndex);
/**
*
* @param rowClass it can be Object[]/List/List/Set/Map/Entity
* @param columnNames
* @param fromRowIndex
* @param toRowIndex
* @param supplier create Multiset
by new Multiset(ArrayHashMap.class)
or Multiset(LinkedArrayHashMap.class)
if rowClass
is array.
* @return
*/
Multiset toMultiset(Class extends T> rowClass, Collection columnNames, int fromRowIndex, int toRowIndex,
IntFunction> supplier);
/**
*
* @param rowSupplier it can be Object[]/List/List/Set/Map/Entity
* @param columnNames
* @return
*/
Multiset toMultiset(IntFunction extends T> rowSupplier, Collection columnNames);
/**
*
* @param rowSupplier it can be Object[]/List/List/Set/Map/Entity
* @param columnNames
* @param fromRowIndex
* @param toRowIndex
* @return
*/
Multiset toMultiset(IntFunction extends T> rowSupplier, Collection columnNames, int fromRowIndex, int toRowIndex);
/**
*
* @param rowSupplier it can be Object[]/List/List/Set/Map/Entity
* @param columnNames
* @param fromRowIndex
* @param toRowIndex
* @param supplier create Multiset
by new Multiset(ArrayHashMap.class)
or Multiset(LinkedArrayHashMap.class)
if rowClass
is array.
* @return
*/
Multiset toMultiset(IntFunction extends T> rowSupplier, Collection columnNames, 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
*/
void toJSON(File out);
/**
*
* @param out
* @param fromRowIndex
* @param toRowIndex
*/
void toJSON(File out, int fromRowIndex, int toRowIndex);
/**
*
* @param out
* @param columnNames
* @param fromRowIndex
* @param toRowIndex
*/
void toJSON(File out, Collection columnNames, int fromRowIndex, int toRowIndex);
/**
*
* @param os
*/
void toJSON(OutputStream out);
/**
*
* @param os
* @param fromRowIndex
* @param toRowIndex
*/
void toJSON(OutputStream out, int fromRowIndex, int toRowIndex);
/**
*
* @param os
* @param columnNames
* @param fromRowIndex
* @param toRowIndex
*/
void toJSON(OutputStream out, Collection columnNames, int fromRowIndex, int toRowIndex);
/**
*
* @param os
*/
void toJSON(Writer out);
/**
*
* @param os
* @param fromRowIndex
* @param toRowIndex
*/
void toJSON(Writer out, int fromRowIndex, int toRowIndex);
/**
*
* @param os
* @param columnNames
* @param fromRowIndex
* @param toRowIndex
*/
void toJSON(Writer out, Collection columnNames, int fromRowIndex, int toRowIndex);
/**
*
* @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
*/
void toXML(File out);
/**
* @param out
* @param rowElementName
*/
void toXML(File out, String rowElementName);
/**
*
* @param out
* @param fromRowIndex
* @param toRowIndex
*/
void toXML(File out, int fromRowIndex, int toRowIndex);
/**
* @param out
* @param rowElementName
* @param fromRowIndex
* @param toRowIndex
*/
void toXML(File out, String rowElementName, int fromRowIndex, int toRowIndex);
/**
*
* @param out
* @param columnNames
* @param fromRowIndex
* @param toRowIndex
*/
void toXML(File out, Collection columnNames, int fromRowIndex, int toRowIndex);
/**
* @param out
* @param rowElementName
* @param columnNames
* @param fromRowIndex
* @param toRowIndex
*/
void toXML(File out, String rowElementName, Collection columnNames, int fromRowIndex, int toRowIndex);
/**
* @param out
*/
void toXML(OutputStream out);
/**
* @param out
* @param rowElementName
*/
void toXML(OutputStream out, String rowElementName);
/**
*
* @param out
* @param fromRowIndex
* @param toRowIndex
*/
void toXML(OutputStream out, int fromRowIndex, int toRowIndex);
/**
* @param out
* @param rowElementName
* @param fromRowIndex
* @param toRowIndex
*/
void toXML(OutputStream out, String rowElementName, int fromRowIndex, int toRowIndex);
/**
*
* @param out
* @param columnNames
* @param fromRowIndex
* @param toRowIndex
*/
void toXML(OutputStream out, Collection columnNames, int fromRowIndex, int toRowIndex);
/**
* @param out
* @param rowElementName
* @param columnNames
* @param fromRowIndex
* @param toRowIndex
*/
void toXML(OutputStream out, String rowElementName, Collection columnNames, int fromRowIndex, int toRowIndex);
/**
* @param out
*/
void toXML(Writer out);
/**
* @param out
* @param rowElementName
*/
void toXML(Writer out, String rowElementName);
/**
*
* @param out
* @param fromRowIndex
* @param toRowIndex
*/
void toXML(Writer out, int fromRowIndex, int toRowIndex);
/**
* @param out
* @param rowElementName
* @param fromRowIndex
* @param toRowIndex
*/
void toXML(Writer out, String rowElementName, int fromRowIndex, int toRowIndex);
/**
*
* @param out
* @param columnNames
* @param fromRowIndex
* @param toRowIndex
*/
void toXML(Writer out, Collection columnNames, int fromRowIndex, int toRowIndex);
/**
* @param out
* @param rowElementName
* @param columnNames
* @param fromRowIndex
* @param toRowIndex
*/
void toXML(Writer out, String rowElementName, Collection columnNames, int fromRowIndex, int toRowIndex);
/**
*
*/
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
*/
void toCSV(File out);
/**
*
* @param out
* @param columnNames
* @param fromRowIndex
* @param toRowIndex
*/
void toCSV(File out, Collection columnNames, int fromRowIndex, int toRowIndex);
/**
*
* @param out
* @param writeTitle
* @param quoteValue
*/
void toCSV(File out, boolean writeTitle, boolean quoteValue);
/**
*
* @param out
* @param columnNames
* @param fromRowIndex
* @param toRowIndex
* @param writeTitle
* @param quoteValue
*/
void toCSV(File out, Collection columnNames, int fromRowIndex, int toRowIndex, boolean writeTitle, boolean quoteValue);
/**
*
* @param out
*/
void toCSV(OutputStream out);
/**
*
* @param out
* @param columnNames
* @param fromRowIndex
* @param toRowIndex
*/
void toCSV(OutputStream out, Collection columnNames, int fromRowIndex, int toRowIndex);
/**
*
* @param out
* @param writeTitle
* @param quoteValue
*/
void toCSV(OutputStream out, boolean writeTitle, boolean quoteValue);
/**
*
* @param out
* @param columnNames
* @param fromRowIndex
* @param toRowIndex
* @param writeTitle
* @param quoteValue
*/
void toCSV(OutputStream out, Collection columnNames, int fromRowIndex, int toRowIndex, boolean writeTitle, boolean quoteValue);
/**
*
* @param out
*/
void toCSV(Writer out);
/**
*
* @param out
* @param columnNames
* @param fromRowIndex
* @param toRowIndex
*/
void toCSV(Writer out, Collection columnNames, int fromRowIndex, int toRowIndex);
/**
*
* @param out
* @param writeTitle
* @param quoteValue
*/
void toCSV(Writer out, boolean writeTitle, boolean quoteValue);
/**
*
* @param out
* @param columnNames
* @param fromRowIndex
* @param toRowIndex
* @param writeTitle
* @param quoteValue
*/
void toCSV(Writer out, Collection columnNames, int fromRowIndex, int toRowIndex, boolean writeTitle, boolean quoteValue);
/**
*
* @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 super Object[]> cmp);
/**
*
* @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 super Object[]> cmp);
/**
*
* @param columnName specifying the column to group by.
* @return
*/
DataSet groupBy(String columnName);
/**
*
* @param columnName specifying the column to group by.
* @param keyExtractor don't change value of the input parameter.
* @return
*/
DataSet groupBy(String columnName, Function, ?> keyExtractor);
/**
*
* @param columnName specifying the column to group by.
* @param aggregateResultColumnName
* @param aggregateOnColumnName specifying the column to apply the collector.
* @param collector refer to {@link com.landawn.abacus.util.stream.Collectors#groupingBy(Function, Collector)}.
* For example, set collector to {@link com.landawn.abacus.util.stream.Collectors#counting()} to count the row number.
* @return
*/
DataSet groupBy(String columnName, String aggregateResultColumnName, String aggregateOnColumnName, Collector collector);
/**
*
* @param columnName specifying the column to group by.
* @param aggregateResultColumnName
* @param aggregateOnColumnNames specifying the column to apply the collector.
* @param collector refer to {@link com.landawn.abacus.util.stream.Collectors#groupingBy(Function, Collector)}.
* For example, set collector to {@link com.landawn.abacus.util.stream.Collectors#counting()} to count the row number.
* @return
*/
DataSet groupBy(String columnName, String aggregateResultColumnName, Collection aggregateOnColumnNames,
Collector super Object[], ?, ?> collector);
/**
*
* @param columnName specifying the column to group by.
* @param keyExtractor don't change value of the input parameter.
* @param aggregateResultColumnName
* @param aggregateOnColumnName specifying the column to apply the collector.
* @param collector refer to {@link com.landawn.abacus.util.stream.Collectors#groupingBy(Function, Collector)}.
* For example, set collector to {@link com.landawn.abacus.util.stream.Collectors#counting()} to count the row number.
* @return
*/
DataSet groupBy(String columnName, Function, ?> keyExtractor, String aggregateResultColumnName, String aggregateOnColumnName,
Collector collector);
/**
*
* @param columnName specifying the column to group by.
* @param keyExtractor don't change value of the input parameter.
* @param aggregateResultColumnName
* @param aggregateOnColumnNames specifying the columns to apply the collector.
* @param collector refer to {@link com.landawn.abacus.util.stream.Collectors#groupingBy(Function, Collector)}.
* For example, set collector to {@link com.landawn.abacus.util.stream.Collectors#counting()} to count the row number.
* @return
*/
DataSet groupBy(String columnName, Function, ?> keyExtractor, String aggregateResultColumnName, Collection aggregateOnColumnNames,
Collector super Object[], ?, ?> collector);
/**
*
* @param columnName specifying the column to group by.
* @param fromRowIndex
* @param toRowIndex
* @return
*/
DataSet groupBy(String columnName, int fromRowIndex, int toRowIndex);
/**
*
* @param columnName specifying the column to group by.
* @param fromRowIndex
* @param toRowIndex
* @param keyExtractor don't change value of the input parameter.
* @return
*/
DataSet groupBy(String columnName, int fromRowIndex, int toRowIndex, Function, ?> keyExtractor);
/**
*
* @param columnName specifying the column to group by.
* @param fromRowIndex
* @param toRowIndex
* @param aggregateResultColumnName
* @param aggregateOnColumnName specifying the column to apply the collector.
* @param collector refer to {@link com.landawn.abacus.util.stream.Collectors#groupingBy(Function, Collector)}.
* For example, set collector to {@link com.landawn.abacus.util.stream.Collectors#counting()} to count the row number.
* @return
*/
DataSet groupBy(String columnName, int fromRowIndex, int toRowIndex, String aggregateResultColumnName, String aggregateOnColumnName,
Collector collector);
/**
*
* @param columnName specifying the column to group by.
* @param fromRowIndex
* @param toRowIndex
* @param aggregateResultColumnName
* @param aggregateOnColumnNames specifying the columns to apply the collector.
* @param collector refer to {@link com.landawn.abacus.util.stream.Collectors#groupingBy(Function, Collector)}.
* For example, set collector to {@link com.landawn.abacus.util.stream.Collectors#counting()} to count the row number.
* @return
*/
DataSet groupBy(String columnName, int fromRowIndex, int toRowIndex, String aggregateResultColumnName, Collection aggregateOnColumnNames,
Collector super Object[], ?, ?> collector);
/**
*
* @param columnName specifying the column to group by.
* @param fromRowIndex
* @param toRowIndex
* @param keyExtractor don't change value of the input parameter.
* @param aggregateResultColumnName
* @param aggregateOnColumnName specifying the column to apply the collector.
* @param collector refer to {@link com.landawn.abacus.util.stream.Collectors#groupingBy(Function, Collector)}.
* For example, set collector to {@link com.landawn.abacus.util.stream.Collectors#counting()} to count the row number.
* @return
*/
DataSet groupBy(String columnName, int fromRowIndex, int toRowIndex, Function, ?> keyExtractor, String aggregateResultColumnName,
String aggregateOnColumnName, Collector collector);
/**
*
* @param columnName specifying the column to group by.
* @param fromRowIndex
* @param toRowIndex
* @param keyExtractor don't change value of the input parameter.
* @param aggregateResultColumnName
* @param aggregateOnColumnNames specifying the columns to apply the collector.
* @param collector refer to {@link com.landawn.abacus.util.stream.Collectors#groupingBy(Function, Collector)}.
* For example, set collector to {@link com.landawn.abacus.util.stream.Collectors#counting()} to count the row number.
* @return
*/
DataSet groupBy(String columnName, int fromRowIndex, int toRowIndex, Function, ?> keyExtractor, String aggregateResultColumnName,
Collection aggregateOnColumnNames, Collector super Object[], ?, ?> collector);
/**
*
* @param columnNames specifying the columns to group by.
* @return
*/
DataSet groupBy(Collection columnNames);
/**
*
* @param columnNames specifying the columns to group by.
* @param keyExtractor don't change value of the input parameter.
* For example, set collector to {@link com.landawn.abacus.util.stream.Collectors#counting()} to count the row number.
* @return
*/
DataSet groupBy(Collection columnNames, Function super Object[], ?> keyExtractor);
/**
*
* @param columnNames specifying the columns to group by.
* @param aggregateResultColumnName
* @param aggregateOnColumnName specifying the column to apply the collector.
* @param collector refer to {@link com.landawn.abacus.util.stream.Collectors#groupingBy(Function, Collector)}.
* For example, set collector to {@link com.landawn.abacus.util.stream.Collectors#counting()} to count the row number.
* @return
*/
DataSet groupBy(Collection columnNames, String aggregateResultColumnName, String aggregateOnColumnName, Collector collector);
/**
*
* @param columnNames specifying the columns to group by.
* @param aggregateResultColumnName
* @param aggregateOnColumnNames specifying the column to apply the collector.
* @param collector refer to {@link com.landawn.abacus.util.stream.Collectors#groupingBy(Function, Collector)}.
* For example, set collector to {@link com.landawn.abacus.util.stream.Collectors#counting()} to count the row number.
* @return
*/
DataSet groupBy(Collection