protected Object readAs ( DapVariable atomvar , DapType basetype , List < Slice > slices ) throws DapException { if ( basetype . getTypeSort ( ) == TypeSort . Enum ) { // short circuit this case basetype = ( ( DapEnumeration ) basetype ) . getBaseType ( ) ; return readAs ( atomvar , basetype , slices ) ; } long count = DapUtil . sliceProduct ( slices ) ; Object result = LibTypeFcns . newVector ( basetype , count ) ; Odometer odom = Odometer . factory ( slices ) ; if ( DapUtil . isContiguous ( slices ) && basetype . isFixedSize ( ) ) readContig ( slices , basetype , count , odom , result ) ; else readOdom ( slices , basetype , odom , result ) ; return result ; }
Allow specification of basetype to use ; used for enumerations