static public Index factory ( int [ ] shape ) { int rank = shape . length ; switch ( rank ) { case 0 : return new Index0D ( ) ; case 1 : return new Index1D ( shape ) ; case 2 : return new Index2D ( shape ) ; case 3 : return new Index3D ( shape ) ; case 4 : return new Index4D ( shape ) ; case 5 : return new Index5D ( shape ) ; case 6 : return new Index6D ( shape ) ; case 7 : return new Index7D ( shape ) ; default : return new Index ( shape ) ; } }
Generate a subclass of Index optimized for this array s rank