protected Float getExpressionRatio ( MediaExpression e ) { if ( e . size ( ) == 2 ) //the ratio is two integer values { Term < ? > term1 = e . get ( 0 ) ; Term < ? > term2 = e . get ( 1 ) ; if ( term1 instanceof TermInteger && term2 instanceof TermInteger && ( ( ( TermInteger ) term2 ) . getOperator ( ) == Operator . SLASH ) ) return ( ( TermInteger ) term1 ) . getValue ( ) / ( ( TermInteger ) term2 ) . getValue ( ) ; else return null ; } else return null ; }
Obtains the ratio specified by the given media query expression .