private static BigInteger getMultiChoice ( int [ ] choices , JSchema schema , JSVariant var ) throws JMFUninitializedAccessException { int choice = choices [ var . getIndex ( ) ] ; if ( choice == - 1 ) throw new JMFUninitializedAccessException ( schema . getPathName ( var ) ) ; BigInteger ans = BigInteger . ZERO ; // First, add the contribution of the cases less than the present one. for ( int i = 0 ; i < choice ; i ++ ) ans = ans . ( ( ( JSType ) var . getCase ( i ) ) . getMultiChoiceCount ( ) ) ; // Now compute the contribution of the actual case. Get the subvariants dominated by // this variant's present case. JSVariant [ ] subVars = var . getDominatedVariants ( choice ) ; if ( subVars == null ) // There are none: we already have the answer return ans ; return ans . add ( getMultiChoice ( choices , schema , subVars ) ) ; }
Compute the multiChoice code or contribution for an individual variant