Skip to content
Snippets Groups Projects
Commit eee4b96f authored by Guyslain's avatar Guyslain
Browse files

section 8 ConstantCellInitializer fini

parent 620db9c5
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,8 @@ import datastruct.MatrixInitializer; ...@@ -11,7 +11,8 @@ import datastruct.MatrixInitializer;
* @param <T> the type of content of each cell * @param <T> the type of content of each cell
*/ */
public class ConstantCellInitializer<T> implements MatrixInitializer<Cell<T>> { public class ConstantCellInitializer<T> implements MatrixInitializer<Cell<T>> {
//TODO: ajouter la/les propriétes nécessaires
private final T value;
/** Make a new {@link MatrixInitializer} with cells containing a {@link Cell} with the same /** Make a new {@link MatrixInitializer} with cells containing a {@link Cell} with the same
* value. * value.
...@@ -19,12 +20,11 @@ public class ConstantCellInitializer<T> implements MatrixInitializer<Cell<T>> { ...@@ -19,12 +20,11 @@ public class ConstantCellInitializer<T> implements MatrixInitializer<Cell<T>> {
* @param defaultValue the value stored in each cell. * @param defaultValue the value stored in each cell.
*/ */
public ConstantCellInitializer(T defaultValue) { public ConstantCellInitializer(T defaultValue) {
//TODO: à compléter this.value = defaultValue;
} }
@Override @Override
public Cell<T> initialValueAt(Coordinate coordinate) { public Cell<T> initialValueAt(Coordinate coordinate) {
//TODO: à compléter return new Cell<>(value);
return null;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment