Klasse Matrix<E>
java.lang.Object
ch.nolix.core.container.base.AbstractContainer<E>
ch.nolix.core.container.arraylist.AbstractExtendedContainer<E>
ch.nolix.core.container.matrix.Matrix<E>
- Typparameter:
E- is the type of the elements of aMatrix.
- Alle implementierten Schnittstellen:
Filterable<E>, Groupable<E>, IContainer<E>, IFilteringContainerViewProvider<E>, IIntervallContainerViewProvider<E>, IMappingContainerViewProvider<E>, Mappable<E>, AggregationRequestable<E>, ArrayMappable<E>, CountRequestable<E>, IndexRequestable<E>, IterableWithCopyableIterator<E>, SingleSearchable<E>, StoringRequestable<E>, StringMappable, IMatrix<E>, Clearable, EmptinessRequestable, MaterializationRequestable, Iterable<E>
A
Matrix is a AbstractContainer that stores its elements in
rows and columns. A Matrix is clearable.- Autor:
- Silvan Wyss
-
Methodenübersicht
Modifikator und TypMethodeBeschreibungAdds a new column to the currentMatrixwith the given elements.Adds a new column to the currentMatrixwith the given elements.Adds a new row to the currentMatrixwith the given elements.Adds a new row to the currentMatrixwith the given elements.voidclear()Removes all elements of the currentMatrix.static <T> Matrix<T> static <T> Matrix<T> fromMatrix(IMatrix<T> matrix) getColumn(int columnIndex) intThe time complexity of this implementation is O(1).intgetColumnIndexOf(int index) getCopy()The time complexity of this implementation is O(m * n) if: -This matrix contains m rows.intgetCount()The time complexity of this implementation is O(1).intgetIndexOf(int rowIndex, int columnIndex) getRow(int rowIndex) intThe time complexity of this implementation is O(1).intgetRowIndexOf(int index) getRows()getStoredAtOneBasedIndex(int oneBasedIndex) getStoredAtOneBasedRowIndexAndColumnIndex(int oneBasedRowIndex, int oneBasedColumnIndex) The time complexity of this implementation is O(1).booleaniterator()The time complexity of this implementation is O(1).voidSets the given element to the currentMatrixat the given index.voidsetAtOneBasedRowIndexAndColumnIndex(int oneBasedRowIndex, int oneBasedColumnIndex, E element) Sets the given element to the currentMatrixto the row with the given row index and the column with the given column index.The time complexity of this implementation is O(n) if the currentMatrixcontains n elements.<O> Matrix<O> The time complexity of this implementation is O(n) if: -This matrix contains n elements.The time complexity of this implementation is O(n) if the currentMatrixcontains n elements.toString()The time complexity of this implementation is O(n) if: -The currentMatrixcontains n elements.Von Klasse geerbte Methoden AbstractExtendedContainer
createEmptyMutableList, getViewFromOneBasedStartIndexToOneBasedEndIndex, getViewOf, getViewOfStoredSelected, toOrderedListVon Klasse geerbte Methoden AbstractContainer
contains, containsAll, containsAll, containsAll, containsAny, containsAny, containsAnyOf, containsAnyOf, containsAsManyAs, containsEqualing, containsExactlyEqualingInSameOrder, containsExactlyInSameOrder, containsLessThan, containsMoreThan, containsNone, containsNone, containsNoneOf, containsOnce, containsOne, containsOne, containsOneEqualing, containsOnly, getAverage, getAverageOrZero, getCount, getCountOf, getMax, getMaxOrZero, getMedian, getMedianOrZero, getMin, getMinOrZero, getOneBasedIndexOfFirst, getOneBasedIndexOfFirstEqualElement, getOneBasedIndexOfFirstOccurrenceOf, getOptionalStoredFirst, getOptionalStoredFirst, getStandardDeviation, getStoredByMax, getStoredByMin, getStoredFirst, getStoredFirst, getStoredFirstOfType, getStoredInGroups, getStoredLast, getStoredOfType, getStoredOne, getStoredOne, getStoredOthers, getStoredSelected, getSum, getSumOfInts, getVariance, getViewFromOneBasedStartIndex, getViewToOneBasedEndIndex, getViewWithoutFirst, getViewWithoutFirst, getViewWithoutLast, getViewWithoutLast, isEmpty, to, toArray, toByteArray, toCharArray, toConcatenatedString, toDoubleArray, toIntArray, toLongArray, toMultiples, toNumbers, toReversedList, toStringArray, toStrings, toStringWithSeparator, toStringWithSeparator, toWithOneBasedIndexVon Klasse geerbte Methoden Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitVon Schnittstelle geerbte Methoden AggregationRequestable
getAverage, getAverageOrZero, getMax, getMaxOrZero, getMedian, getMedianOrZero, getMin, getMinOrZero, getStandardDeviation, getSum, getSumOfInts, getVarianceVon Schnittstelle geerbte Methoden ArrayMappable
toArray, toByteArray, toCharArray, toDoubleArray, toIntArray, toLongArray, toStringArrayVon Schnittstelle geerbte Methoden CountRequestable
getCount, getCountOfVon Schnittstelle geerbte Methoden EmptinessRequestable
containsAny, isEmptyVon Schnittstelle geerbte Methoden Filterable
getStoredOfType, getStoredOthers, getStoredSelectedVon Schnittstelle geerbte Methoden Groupable
getStoredInGroupsVon Schnittstelle geerbte Methoden IContainer
toOrderedList, toReversedListVon Schnittstelle geerbte Methoden IFilteringContainerViewProvider
getViewOfStoredSelectedVon Schnittstelle geerbte Methoden IIntervallContainerViewProvider
getViewFromOneBasedStartIndex, getViewFromOneBasedStartIndexToOneBasedEndIndex, getViewToOneBasedEndIndex, getViewWithoutFirst, getViewWithoutFirst, getViewWithoutLast, getViewWithoutLastVon Schnittstelle geerbte Methoden IMappingContainerViewProvider
getViewOfVon Schnittstelle geerbte Methoden IndexRequestable
getOneBasedIndexOfFirst, getOneBasedIndexOfFirstEqualElement, getOneBasedIndexOfFirstOccurrenceOfVon Schnittstelle geerbte Methoden Iterable
forEach, spliteratorVon Schnittstelle geerbte Methoden Mappable
to, toMultiples, toNumbers, toStrings, toWithOneBasedIndexVon Schnittstelle geerbte Methoden MaterializationRequestable
isViewVon Schnittstelle geerbte Methoden SingleSearchable
getOptionalStoredFirst, getOptionalStoredFirst, getStoredByMax, getStoredByMin, getStoredFirst, getStoredFirst, getStoredFirstOfType, getStoredLast, getStoredOne, getStoredOneVon Schnittstelle geerbte Methoden StoringRequestable
contains, containsAll, containsAll, containsAll, containsAny, containsAny, containsAnyOf, containsAnyOf, containsAsManyAs, containsEqualing, containsExactlyEqualingInSameOrder, containsExactlyInSameOrder, containsLessThan, containsMoreThan, containsNone, containsNone, containsNoneOf, containsOnce, containsOne, containsOne, containsOneEqualing, containsOnlyVon Schnittstelle geerbte Methoden StringMappable
toConcatenatedString, toStringWithSeparator, toStringWithSeparator
-
Methodendetails
-
createEmpty
-
fromMatrix
-
addColumn
Adds a new column to the currentMatrixwith the given elements. The complexity of this implementation is O(m + n) if: -The currentMatrixcontains m elements. -n elements are given.- Parameter:
element-elements-- Gibt zurück:
- the current
Matrix. - Löst aus:
ArgumentIsNullException- if the given elements is null.ArgumentIsNullException- if one of the given elements is null.UnequalArgumentException- if the currentMatrixis not empty and if not as many elements are given as the number of rows of the currentMatrix.
-
addColumn
Adds a new column to the currentMatrixwith the given elements. The complexity of this implementation is O(m + n) if: -The currentMatrixcontains m elements. -n elements are given.- Parameter:
elements-- Gibt zurück:
- the current
Matrix. - Löst aus:
ArgumentIsNullException- if the given elements is null.ArgumentIsNullException- if one of the given elements is null.UnequalArgumentException- if the currentMatrixis not empty and if not as many elements are given as the number of rows of the currentMatrix.
-
addRow
Adds a new row to the currentMatrixwith the given elements. The complexity of this implementation is O(m + n) if: -The currentMatrixcontains m rows. -n elements are given.- Parameter:
elements-- Gibt zurück:
- the current
Matrix. - Löst aus:
ArgumentIsNullException- if the given elements is null.ArgumentIsNullException- if one of the given elements is null.UnequalArgumentException- the currentMatrixis not empty and if not as many elements are given as the number of columns of the currentMatrix.
-
addRow
Adds a new row to the currentMatrixwith the given elements. The complexity of this implementation is O(m + n) if: -The currentMatrixcontains m rows. -n elements are given.- Parameter:
elements-- Gibt zurück:
- the current
Matrix. - Löst aus:
ArgumentIsNullException- if the given elements is null.ArgumentIsNullException- if one of the given elements is null.UnequalArgumentException- the currentMatrixis not empty and if not as many elements are given as the number of columns of the currentMatrix.
-
clear
-
getColumn
- Parameter:
columnIndex-- Gibt zurück:
- the column of the current
Matrixwith the given column index. - Löst aus:
NonPositiveArgumentException- if the given column index is not positive.BiggerArgumentException- if the given column index is bigger than the number of columns of the currentMatrix.
-
getColumnCount
public int getColumnCount()The time complexity of this implementation is O(1).- Angegeben von:
getColumnCountin SchnittstelleIMatrix<E>- Gibt zurück:
- the number of columns of the current
Matrix.
-
getColumnIndexOf
public int getColumnIndexOf(int index) - Parameter:
index-- Gibt zurück:
- the index of the column of the element of the current
Matrixat the given index. - Löst aus:
NonPositiveArgumentException- if the given index is not positive.BiggerArgumentException- if the given index is bigger than the number of elements of the currentMatrix.
-
getColumns
- Angegeben von:
getColumnsin SchnittstelleIMatrix<E>- Gibt zurück:
- the columns of the current
Matrix.
-
getCopy
-
getCount
public int getCount()The time complexity of this implementation is O(1).- Angegeben von:
getCountin SchnittstelleCountRequestable<E>- Gibt zurück:
- the number of elements of the current
Matrix.
-
getIndexOf
public int getIndexOf(int rowIndex, int columnIndex) - Parameter:
rowIndex-columnIndex-- Gibt zurück:
- the index of the element of the current
Matrixat the given row index and column index. - Löst aus:
NonPositiveArgumentException- if the given row index is not positive.BiggerArgumentException- if the given row index is bigger than the number of rows of the currentMatrix.NonPositiveArgumentException- if the given column index is not positive.BiggerArgumentException- if the given column index is bigger than the number of columns of the currentMatrix.
-
getStoredAtOneBasedIndex
- Angegeben von:
getStoredAtOneBasedIndexin SchnittstelleSingleSearchable<E>- Parameter:
oneBasedIndex-- Gibt zurück:
- the element of the current
Matrixat the given index . - Löst aus:
NonPositiveArgumentException- if the given index is not positive.BiggerArgumentException- if the given index is bigger than the number of elements of the currentMatrix.
-
getStoredAtOneBasedRowIndexAndColumnIndex
The time complexity of this implementation is O(1).- Angegeben von:
getStoredAtOneBasedRowIndexAndColumnIndexin SchnittstelleIMatrix<E>- Parameter:
oneBasedRowIndex-oneBasedColumnIndex-- Gibt zurück:
- the element of the current
Matrixat the given row index and column index. - Löst aus:
NonPositiveArgumentException- if the given row index is not positive.BiggerArgumentException- if the given row index is bigger than the number of rows of the currentMatrix.NonPositiveArgumentException- if the given column index is not positive.BiggerArgumentException- if the given column index is bigger than the number of columns of the currentMatrix.
-
getRow
- Parameter:
rowIndex-- Gibt zurück:
- the row of the current
Matrixat the given row index. - Löst aus:
NonPositiveArgumentException- if the given row index is not positive.BiggerArgumentException- if the given row index is bigger than the number of rows of the currentMatrix.
-
getRowIndexOf
public int getRowIndexOf(int index) - Parameter:
index-- Gibt zurück:
- the index of the row of the element of the current
Matrixat the given index. - Löst aus:
NonPositiveArgumentException- if the given index is not positive.BiggerArgumentException- if the given index is bigger than the number of elements of the currentMatrix.
-
getRows
-
getRowCount
public int getRowCount()The time complexity of this implementation is O(1).- Angegeben von:
getRowCountin SchnittstelleIMatrix<E>- Gibt zurück:
- the number of rows of the current
Matrix.
-
isMaterialized
public boolean isMaterialized()- Angegeben von:
isMaterializedin SchnittstelleMaterializationRequestable- Gibt zurück:
- true if the current
MaterializationRequestableis materialized, false otherwise.
-
iterator
The time complexity of this implementation is O(1). -
setAt
Sets the given element to the currentMatrixat the given index. The complexity of this implementation is O(1).- Parameter:
index-element-- Löst aus:
NonPositiveArgumentException- if the given index is not positive.BiggerArgumentException- if the given index is bigger than the number of elements of the currentMatrix.ArgumentIsNullException- if the given element is null.
-
setAtOneBasedRowIndexAndColumnIndex
public void setAtOneBasedRowIndexAndColumnIndex(int oneBasedRowIndex, int oneBasedColumnIndex, E element) Sets the given element to the currentMatrixto the row with the given row index and the column with the given column index. The time complexity of this implementation is O(1).- Angegeben von:
setAtOneBasedRowIndexAndColumnIndexin SchnittstelleIMatrix<E>- Parameter:
oneBasedRowIndex-oneBasedColumnIndex-element-- Löst aus:
NonPositiveArgumentException- if the given row index is not positive.BiggerArgumentException- if the given row index is bigger than the number of rows of the currentMatrix.NonPositiveArgumentException- if the given column index is not positive.BiggerArgumentException- if the given column index is bigger than the number of columns of the currentMatrix.ArgumentIsNullException- if the given element is null.
-
toMatrix
The time complexity of this implementation is O(n) if: -This matrix contains n elements. -The given transformer has a complexity of O(1).- Typparameter:
O- is the type of the elements the given transformer returns.- Parameter:
transformer-- Gibt zurück:
- a new matrix with the elements the given transformer transforms of
the elements of the current
Matrix.
-
toLeftRotatedMatrix
-
toRightRotatedMatrix
-
toString
-