public final class Sheet<R,C,E>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
Sheet.Cell<R,C,E> |
Constructor and Description |
---|
Sheet(java.util.Collection<R> rowKeySet,
java.util.Collection<C> columnKeySet) |
Sheet(java.util.Collection<R> rowKeySet,
java.util.Collection<C> columnKeySet,
java.lang.Object[][] rows) |
Modifier and Type | Method and Description |
---|---|
void |
addColumn(C columnKey,
java.util.Collection<? extends E> column) |
void |
addColumn(int columnIndex,
C columnKey,
java.util.Collection<? extends E> column) |
void |
addRow(int rowIndex,
R rowKey,
java.util.Collection<? extends E> row) |
void |
addRow(R rowKey,
java.util.Collection<? extends E> row) |
Stream<Stream<Sheet.Cell<R,C,E>>> |
cellsC() |
Stream<Stream<Sheet.Cell<R,C,E>>> |
cellsC(int fromColumnIndex,
int toColumnIndex) |
Stream<Sheet.Cell<R,C,E>> |
cellsH() |
Stream<Sheet.Cell<R,C,E>> |
cellsH(int rowIndex) |
Stream<Sheet.Cell<R,C,E>> |
cellsH(int fromRowIndex,
int toRowIndex) |
Stream<Stream<Sheet.Cell<R,C,E>>> |
cellsR() |
Stream<Stream<Sheet.Cell<R,C,E>>> |
cellsR(int fromRowIndex,
int toRowIndex) |
Stream<Sheet.Cell<R,C,E>> |
cellsV() |
Stream<Sheet.Cell<R,C,E>> |
cellsV(int columnIndex) |
Stream<Sheet.Cell<R,C,E>> |
cellsV(int fromColumnIndex,
int toColumnIndex) |
void |
clear() |
Sheet<R,C,E> |
clone()
Deeply copy each element in this
Sheet by Serialization/Deserialization. |
Sheet<R,C,E> |
clone(boolean freeze)
Deeply copy each element in this
Sheet by Serialization/Deserialization. |
java.util.Map<R,E> |
column(java.lang.Object columnKey) |
java.util.Set<C> |
columnKeySet() |
int |
columnLength()
Returns the size of column key set.
|
java.util.Map<C,java.util.Map<R,E>> |
columnMap() |
static <R,C,E> Sheet<R,C,E> |
columns(java.util.Collection<R> rowKeySet,
java.util.Collection<C> columnKeySet,
java.util.Collection<? extends java.util.Collection<? extends E>> columns) |
static <R,C,E> Sheet<R,C,E> |
columns(java.util.Collection<R> rowKeySet,
java.util.Collection<C> columnKeySet,
java.lang.Object[][] columns) |
boolean |
contains(java.lang.Object rowKey,
java.lang.Object columnKey) |
boolean |
containsColumn(java.lang.Object columnKey) |
boolean |
containsRow(java.lang.Object rowKey) |
boolean |
containsValue(java.lang.Object value) |
Sheet<R,C,E> |
copy() |
Sheet<R,C,E> |
copy(java.util.Collection<R> rowKeySet,
java.util.Collection<C> columnKeySet) |
boolean |
equals(java.lang.Object obj) |
void |
freeze() |
boolean |
frozen() |
E |
get(int rowIndex,
int columnIndex) |
E |
get(java.lang.Object rowKey,
java.lang.Object columnKey) |
E |
get(Pair.IntPair point) |
java.util.List<E> |
getColumn(java.lang.Object columnKey) |
java.util.List<E> |
getRow(java.lang.Object rowKey) |
int |
hashCode() |
Sheet<R,C,E> |
merge(Sheet<? extends R,? extends C,? extends E> source,
BiFunction<? super E,? super E,E> mergeFunction) |
void |
moveColumn(java.lang.Object columnKey,
int newColumnIndex)
Move the specified column to the new position.
|
void |
moveRow(java.lang.Object rowKey,
int newRowIndex)
Move the specified row to the new position.
|
Stream<Stream<Pair.IntPair>> |
pointsC() |
Stream<Stream<Pair.IntPair>> |
pointsC(int fromColumnIndex,
int toColumnIndex) |
Stream<Pair.IntPair> |
pointsH() |
Stream<Pair.IntPair> |
pointsH(int rowIndex) |
Stream<Pair.IntPair> |
pointsH(int fromRowIndex,
int toRowIndex) |
Stream<Stream<Pair.IntPair>> |
pointsR() |
Stream<Stream<Pair.IntPair>> |
pointsR(int fromRowIndex,
int toRowIndex) |
Stream<Pair.IntPair> |
pointsV() |
Stream<Pair.IntPair> |
pointsV(int columnIndex) |
Stream<Pair.IntPair> |
pointsV(int fromColumnIndex,
int toColumnIndex) |
void |
println() |
E |
put(int rowIndex,
int columnIndex,
E value) |
E |
put(Pair.IntPair point,
E value) |
E |
put(R rowKey,
C columnKey,
E value) |
void |
putAll(Sheet<? extends R,? extends C,? extends E> source) |
E |
remove(int rowIndex,
int columnIndex) |
E |
remove(java.lang.Object rowKey,
java.lang.Object columnKey) |
E |
remove(Pair.IntPair point) |
void |
removeColumn(java.lang.Object columnKey) |
void |
removeRow(java.lang.Object rowKey) |
void |
renameColumn(C columnKey,
C newColumnKey) |
void |
renameRow(R rowKey,
R newRowKey) |
void |
replaceIf(IntBiPredicate predicate,
E newValue)
Replace elements by
Predicate.test(i, j) based on points |
void |
replaceIf(Predicate<? super E> predicate,
E newValue) |
java.util.Map<C,E> |
row(java.lang.Object rowKey) |
java.util.Set<R> |
rowKeySet() |
int |
rowLength()
Returns the size of row key set.
|
java.util.Map<R,java.util.Map<C,E>> |
rowMap() |
static <R,C,E> Sheet<R,C,E> |
rows(java.util.Collection<R> rowKeySet,
java.util.Collection<C> columnKeySet,
java.util.Collection<? extends java.util.Collection<? extends E>> rows) |
static <R,C,E> Sheet<R,C,E> |
rows(java.util.Collection<R> rowKeySet,
java.util.Collection<C> columnKeySet,
java.lang.Object[][] rows) |
void |
setColumn(C columnKey,
java.util.Collection<? extends E> column) |
void |
setRow(R rowKey,
java.util.Collection<? extends E> row) |
Stream<Stream<E>> |
streamC() |
Stream<Stream<E>> |
streamC(int fromColumnIndex,
int toColumnIndex) |
Stream<E> |
streamH() |
Stream<E> |
streamH(int rowIndex) |
Stream<E> |
streamH(int fromRowIndex,
int toRowIndex) |
Stream<Stream<E>> |
streamR() |
Stream<Stream<E>> |
streamR(int fromRowIndex,
int toRowIndex) |
Stream<E> |
streamV() |
Stream<E> |
streamV(int columnIndex) |
Stream<E> |
streamV(int fromColumnIndex,
int toColumnIndex) |
void |
swapColumn(java.lang.Object columnKeyA,
java.lang.Object columnKeyB)
Swap the positions of the two specified columns.
|
void |
swapRow(java.lang.Object rowKeyA,
java.lang.Object rowKeyB)
Swap the positions of the two specified rows.
|
java.lang.Object[][] |
toArrayH() |
<T> T[][] |
toArrayH(java.lang.Class<T> cls) |
java.lang.Object[][] |
toArrayV() |
<T> T[][] |
toArrayV(java.lang.Class<T> cls) |
DataSet |
toDataSetH() |
DataSet |
toDataSetV() |
Matrix<E> |
toMatrixH(java.lang.Class<E> cls) |
Matrix<E> |
toMatrixV(java.lang.Class<E> cls) |
java.lang.String |
toString() |
Sheet<C,R,E> |
transpose() |
void |
trimToSize() |
void |
updateAll(Function<? super E,E> func) |
void |
updateAll(IntBiFunction<E> func)
Update all elements based on points
|
void |
updateColumn(C columnKey,
Function<? super E,E> func) |
void |
updateRow(R rowKey,
Function<? super E,E> func) |
public static <R,C,E> Sheet<R,C,E> rows(java.util.Collection<R> rowKeySet, java.util.Collection<C> columnKeySet, java.lang.Object[][] rows)
public static <R,C,E> Sheet<R,C,E> rows(java.util.Collection<R> rowKeySet, java.util.Collection<C> columnKeySet, java.util.Collection<? extends java.util.Collection<? extends E>> rows)
public static <R,C,E> Sheet<R,C,E> columns(java.util.Collection<R> rowKeySet, java.util.Collection<C> columnKeySet, java.lang.Object[][] columns)
public static <R,C,E> Sheet<R,C,E> columns(java.util.Collection<R> rowKeySet, java.util.Collection<C> columnKeySet, java.util.Collection<? extends java.util.Collection<? extends E>> columns)
public java.util.Set<R> rowKeySet()
public java.util.Set<C> columnKeySet()
public E get(java.lang.Object rowKey, java.lang.Object columnKey)
public E get(int rowIndex, int columnIndex)
rowIndex
- columnIndex
- public E get(Pair.IntPair point)
public E put(Pair.IntPair point, E value)
public E remove(java.lang.Object rowKey, java.lang.Object columnKey)
public E remove(int rowIndex, int columnIndex)
public E remove(Pair.IntPair point)
public boolean contains(java.lang.Object rowKey, java.lang.Object columnKey)
public boolean containsValue(java.lang.Object value)
public java.util.List<E> getRow(java.lang.Object rowKey)
public void removeRow(java.lang.Object rowKey)
public void moveRow(java.lang.Object rowKey, int newRowIndex)
rowKey
- newRowIndex
- public void swapRow(java.lang.Object rowKeyA, java.lang.Object rowKeyB)
rowKeyA
- rowKeyB
- public boolean containsRow(java.lang.Object rowKey)
public java.util.List<E> getColumn(java.lang.Object columnKey)
public void addColumn(int columnIndex, C columnKey, java.util.Collection<? extends E> column)
public void removeColumn(java.lang.Object columnKey)
public void moveColumn(java.lang.Object columnKey, int newColumnIndex)
columnKey
- newColumnIndex
- public void swapColumn(java.lang.Object columnKeyA, java.lang.Object columnKeyB)
columnKeyA
- columnKeyB
- public boolean containsColumn(java.lang.Object columnKey)
public int rowLength()
public int columnLength()
public void updateAll(IntBiFunction<E> func)
func
- public void replaceIf(Predicate<? super E> predicate, E newValue)
predicate
- newValue
- public void replaceIf(IntBiPredicate predicate, E newValue)
Predicate.test(i, j)
based on pointspredicate
- newValue
- public Sheet<R,C,E> copy(java.util.Collection<R> rowKeySet, java.util.Collection<C> columnKeySet)
public Sheet<R,C,E> clone()
Sheet
by Serialization/Deserialization.clone
in class java.lang.Object
public Sheet<R,C,E> clone(boolean freeze)
Sheet
by Serialization/Deserialization.public Sheet<R,C,E> merge(Sheet<? extends R,? extends C,? extends E> source, BiFunction<? super E,? super E,E> mergeFunction)
public void freeze()
public boolean frozen()
public void clear()
public void trimToSize()
public Stream<Sheet.Cell<R,C,E>> cellsH()
public Stream<Sheet.Cell<R,C,E>> cellsH(int rowIndex)
public Stream<Sheet.Cell<R,C,E>> cellsH(int fromRowIndex, int toRowIndex)
fromRowIndex
- toRowIndex
- public Stream<Sheet.Cell<R,C,E>> cellsV()
public Stream<Sheet.Cell<R,C,E>> cellsV(int columnIndex)
columnIndex
- public Stream<Sheet.Cell<R,C,E>> cellsV(int fromColumnIndex, int toColumnIndex)
fromColumnIndex
- toColumnIndex
- public Stream<Stream<Sheet.Cell<R,C,E>>> cellsR()
public Stream<Stream<Sheet.Cell<R,C,E>>> cellsR(int fromRowIndex, int toRowIndex)
fromRowIndex
- toRowIndex
- public Stream<Stream<Sheet.Cell<R,C,E>>> cellsC()
public Stream<Stream<Sheet.Cell<R,C,E>>> cellsC(int fromColumnIndex, int toColumnIndex)
fromColumnIndex
- toColumnIndex
- public Stream<Pair.IntPair> pointsH()
public Stream<Pair.IntPair> pointsH(int rowIndex)
public Stream<Pair.IntPair> pointsH(int fromRowIndex, int toRowIndex)
public Stream<Pair.IntPair> pointsV()
public Stream<Pair.IntPair> pointsV(int columnIndex)
public Stream<Pair.IntPair> pointsV(int fromColumnIndex, int toColumnIndex)
public Stream<Stream<Pair.IntPair>> pointsR()
public Stream<Stream<Pair.IntPair>> pointsR(int fromRowIndex, int toRowIndex)
public Stream<Stream<Pair.IntPair>> pointsC()
public Stream<Stream<Pair.IntPair>> pointsC(int fromColumnIndex, int toColumnIndex)
public Stream<E> streamH(int fromRowIndex, int toRowIndex)
fromRowIndex
- toRowIndex
- public Stream<E> streamV(int fromColumnIndex, int toColumnIndex)
fromColumnIndex
- toColumnIndex
- public Stream<Stream<E>> streamR(int fromRowIndex, int toRowIndex)
fromRowIndex
- toRowIndex
- public Stream<Stream<E>> streamC(int fromColumnIndex, int toColumnIndex)
fromColumnIndex
- toColumnIndex
- public DataSet toDataSetH()
public DataSet toDataSetV()
public Matrix<E> toMatrixH(java.lang.Class<E> cls)
cls
- public Matrix<E> toMatrixV(java.lang.Class<E> cls)
cls
- public java.lang.Object[][] toArrayH()
public <T> T[][] toArrayH(java.lang.Class<T> cls)
public java.lang.Object[][] toArrayV()
public <T> T[][] toArrayV(java.lang.Class<T> cls)
public void println()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object