static List < Dimension > getCoreDimset ( List < Dimension > dimset ) throws DapException { if ( dimset == null ) return null ; List < Dimension > core = new ArrayList <> ( ) ; int pos = - 1 ; int count = 0 ; for ( int i = 0 ; i < dimset . size ( ) ; i ++ ) { if ( dimset . get ( i ) . isVariableLength ( ) ) { pos = i ; count ++ ; } else core . add ( dimset . get ( i ) ) ; } if ( ( pos != dimset . size ( ) - 1 ) || count > 1 ) throw new DapException ( "Unsupported use of (*) Dimension" ) ; return core ; }
Strip vlen dimensions from a set of dimensions