|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
umontreal.iro.lecuyer.collections.AbstractMatrix<E>
E
- the type of the elements.public abstract class AbstractMatrix<E>
Provides default implementation for most
methods of the Matrix
interface.
Field Summary | |
---|---|
protected int |
modCount
This must be incremented each time Matrix.setRows(int)
or Matrix.setColumns(int) modify
the number of rows or columns. |
Constructor Summary | |
---|---|
AbstractMatrix()
|
Method Summary | |
---|---|
List<E> |
asList()
Returns a list using size() to get the
number of elements, and
Matrix.get(int, int) to access elements. |
boolean |
equals(Object o)
Compares the specified object with this matrix for equality. |
int |
hashCode()
Returns the hash code value for the matrix. |
boolean |
isEmpty()
Returns true if Matrix.rows() or
Matrix.columns() return 0. |
Iterator<E> |
iterator()
Constructs and returns an iterator traversing the elements of this matrix rowise. |
E |
set(int r,
int c,
E value)
Sets the element at index (r, c) of the matrix to value, and returns the element previously at that position. |
int |
size()
Returns the product of Matrix.rows()
and Matrix.columns() . |
Object[][] |
to2DArray()
Returns a 2D array containing the elements of this matrix in the proper sequence. |
E[][] |
to2DArray(E[][] array)
Returns a 2D array containing the elements of this matrix in the proper sequence; the runtime type of the returned array is the same as the runtime type of the given array. |
String |
toString()
|
List<E> |
viewColumn(int c)
Returns a list using Matrix.rows() to get the
number of elements, and
Matrix.get(int, int) to access elements. |
Matrix<E> |
viewPart(int fromRow,
int fromColumn,
int toRow,
int toColumn)
Returns a view of a portion of this matrix containing rows fromRow (inclusive) to toRow (exclusive), and columns fromColumn (inclusive) to toColumn (exclusive). |
List<E> |
viewRow(int r)
Returns a list using Matrix.columns() to get the
number of elements, and
Matrix.get(int, int) to access elements. |
Methods inherited from class java.util.AbstractCollection |
---|
add, addAll, clear, contains, containsAll, remove, removeAll, retainAll, toArray, toArray |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface umontreal.iro.lecuyer.collections.Matrix |
---|
columns, get, rows, setColumns, setRows |
Methods inherited from interface java.util.Collection |
---|
add, addAll, clear, contains, containsAll, remove, removeAll, retainAll, toArray, toArray |
Field Detail |
---|
protected int modCount
Matrix.setRows(int)
or Matrix.setColumns(int)
modify
the number of rows or columns.
Constructor Detail |
---|
public AbstractMatrix()
Method Detail |
---|
public List<E> asList()
size()
to get the
number of elements, and
Matrix.get(int, int)
to access elements.
asList
in interface Matrix<E>
public List<E> viewRow(int r)
Matrix.columns()
to get the
number of elements, and
Matrix.get(int, int)
to access elements.
viewRow
in interface Matrix<E>
r
- the index of the row to get a view for.
public List<E> viewColumn(int c)
Matrix.rows()
to get the
number of elements, and
Matrix.get(int, int)
to access elements.
viewColumn
in interface Matrix<E>
c
- the index of the column to get a view for.
public Matrix<E> viewPart(int fromRow, int fromColumn, int toRow, int toColumn)
Matrix
UnsupportedOperationException
if
not implemented.
viewPart
in interface Matrix<E>
fromRow
- the starting row.fromColumn
- the ending row.toRow
- the starting column.toColumn
- the ending column.
public E set(int r, int c, E value)
Matrix
UnsupportedOperationException
if
not implemented.
set
in interface Matrix<E>
r
- the row index.c
- the column index.value
- the value of the element.
public int size()
Matrix.rows()
and Matrix.columns()
.
size
in interface Collection<E>
size
in class AbstractCollection<E>
public boolean isEmpty()
Matrix.rows()
or
Matrix.columns()
return 0.
isEmpty
in interface Collection<E>
isEmpty
in class AbstractCollection<E>
public Iterator<E> iterator()
Matrix
iterator
in interface Iterable<E>
iterator
in interface Collection<E>
iterator
in interface Matrix<E>
iterator
in class AbstractCollection<E>
public boolean equals(Object o)
Matrix
equals
in interface Collection<E>
equals
in interface Matrix<E>
equals
in class Object
public int hashCode()
Matrix
Matrix.asList()
.
This ensures that matrix1.equals (matrix2)
implies that matrix1.hashCode() == matrix2.hashCode()
for any two matrices,
matrix1 and matrix2,
as required by the general contract of
Object.hashCode.
hashCode
in interface Collection<E>
hashCode
in interface Matrix<E>
hashCode
in class Object
public String toString()
toString
in class AbstractCollection<E>
public E[][] to2DArray(E[][] array)
Matrix
to2DArray
in interface Matrix<E>
array
- the array to use.
public Object[][] to2DArray()
Matrix
to2DArray
in interface Matrix<E>
|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |