public static < R > ImmutableGrid < R > copyOf ( int rowCount , int columnCount , Iterable < ? extends Cell < R > > cells ) { if ( cells == null ) { throw new IllegalArgumentException ( "Cells must not be null" ) ; } if ( ! cells . iterator ( ) . hasNext ( ) ) { return new EmptyGrid < R > ( rowCount , columnCount ) ; } return new SparseImmutableGrid < R > ( rowCount , columnCount , cells ) ; }
Obtains an immutable grid by copying a set of cells .