Class DataRowCollection
java.lang.Object
com.github.martincooper.datatable.DataRowCollection
DataRowCollection. Handles a collection of DataRows
Created by Martin Cooper on 17/07/2017.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionio.vavr.collection.Seq<DataRow>asSeq()Returns access to the Data Row collection as a sequence of Data Rows.static DataRowCollectionBuilds a new DataRowCollection for the specified DataTable.static io.vavr.control.Try<DataRowCollection>Builds a new DataRowCollection for the specified DataTable.Filters the row data using the specified predicate, returning the results as a DataView over the original table.<U> io.vavr.collection.Seq<U>FlatMap implementation for the DataRowCollection class.<U> UfoldLeft(U zero, BiFunction<? super U, ? super DataRow, ? extends U> folder) Fold Left implementation for the DataRowCollection class.<U> UfoldRight(U zero, BiFunction<? super DataRow, ? super U, ? extends U> folder) Fold Right implementation for the DataRowCollection class.Returns the Data Row at the specified index.<C> io.vavr.collection.Map<C,io.vavr.collection.Vector<DataRow>> GroupBy implementation for the DataRowCollection class.iterator()Returns an iterator over elements of DataRow.<U> io.vavr.collection.Seq<U>Map implementation for the DataRowCollection class.reduce(BiFunction<? super DataRow, ? super DataRow, ? extends DataRow> reducer) Reduce implementation for the DataRowCollection class.rowCount()The number of rows in the collection.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
table
-
rows
-
-
Method Details
-
build
Builds a new DataRowCollection for the specified DataTable.- Parameters:
table- The table to build the DataRowCollection for.- Returns:
- Returns the DataRowCollection.
-
build
Builds a new DataRowCollection for the specified DataTable.- Parameters:
table- The table to build the DataRowCollection for.rows- The rows to build the table.- Returns:
- Returns the DataRowCollection.
-
iterator
Returns an iterator over elements of DataRow. -
get
Returns the Data Row at the specified index.- Parameters:
rowIndex- The row index.- Returns:
- Returns the Data Row.
-
rowCount
The number of rows in the collection.- Returns:
- Returns the number of rows.
-
asSeq
Returns access to the Data Row collection as a sequence of Data Rows.- Returns:
- Returns the rows.
-
filter
Filters the row data using the specified predicate, returning the results as a DataView over the original table.- Parameters:
predicate- The filter criteria.- Returns:
- Returns a DataView with the filter results.
-
map
Map implementation for the DataRowCollection class.- Type Parameters:
U- Mapped return type.- Parameters:
mapper- The map function.- Returns:
- Returns a sequence of the applied map.
-
flatMap
public <U> io.vavr.collection.Seq<U> flatMap(Function<? super DataRow, ? extends Iterable<? extends U>> mapper) FlatMap implementation for the DataRowCollection class.- Type Parameters:
U- Mapped return type.- Parameters:
mapper- The map function.- Returns:
- Returns a sequence of the applied flatMap.
-
reduce
Reduce implementation for the DataRowCollection class.- Parameters:
reducer- The reduce function.- Returns:
- Returns a single, reduced DataRow.
-
foldLeft
Fold Left implementation for the DataRowCollection class.- Type Parameters:
U- Fold return type.- Parameters:
folder- The fold function.- Returns:
- Returns a single value of U.
-
foldRight
Fold Right implementation for the DataRowCollection class.- Type Parameters:
U- Fold return type.- Parameters:
folder- The fold function.- Returns:
- Returns a single value of U.
-
groupBy
public <C> io.vavr.collection.Map<C,io.vavr.collection.Vector<DataRow>> groupBy(Function<? super DataRow, ? extends C> grouper) GroupBy implementation for the DataRowCollection class.- Parameters:
grouper- The group by function.- Returns:
- Returns a map containing the grouped data.
-