/** * Get the specificity of this expression with respect to the supplied profile set. * <p/> * Iterates over this expressions list of {@link ExpressionToken}s calling * {@link ExpressionToken#getSpecificity(org.milyn.profile.ProfileSet)} and adds up their specificities. * @param profileSet Evaluation Profile Set. * @return Specificity value of the expression for the supplied profile set. */ public double getSpecificity(ProfileSet profileSet) { double specificity = 0; // Only if the expression matches the device. if(isMatch(profileSet)) { for (int i = 0; i < expressionTokens.length; i++) { if(expressionTokens[i].isMatch(profileSet)) { specificity += expressionTokens[i].getSpecificity(profileSet); } } } return specificity; }
/** * Get all SmooksResourceConfiguration entries targeted at the specified profile set. * @param profileSet The profile set to searh against. * @return All SmooksResourceConfiguration entries targeted at the specified profile set. */ public SmooksResourceConfiguration[] getTargetConfigurations(ProfileSet profileSet) { Vector<SmooksResourceConfiguration> matchingSmooksResourceConfigurationsColl = new Vector<SmooksResourceConfiguration>(); SmooksResourceConfiguration[] matchingSmooksResourceConfigurations; // Iterate over the SmooksResourceConfigurations defined on this list. for(int i = 0; i < size(); i++) { SmooksResourceConfiguration resourceConfig = get(i); ProfileTargetingExpression[] profileTargetingExpressions = resourceConfig.getProfileTargetingExpressions(); for(int expIndex = 0; expIndex < profileTargetingExpressions.length; expIndex++) { ProfileTargetingExpression expression = profileTargetingExpressions[expIndex]; if(expression.isMatch(profileSet)) { matchingSmooksResourceConfigurationsColl.addElement(resourceConfig); break; } else { logger.debug("Resource [" + resourceConfig + "] not targeted at profile [" + profileSet.getBaseProfile() + "]. Sub Profiles: [" + profileSet + "]"); } } } matchingSmooksResourceConfigurations = new SmooksResourceConfiguration[matchingSmooksResourceConfigurationsColl.size()]; matchingSmooksResourceConfigurationsColl.toArray(matchingSmooksResourceConfigurations); return matchingSmooksResourceConfigurations; }
/** * Get the specificity of this expression with respect to the supplied profile set. * <p/> * Iterates over this expressions list of {@link ExpressionToken}s calling * {@link ExpressionToken#getSpecificity(org.milyn.profile.ProfileSet)} and adds up their specificities. * @param profileSet Evaluation Profile Set. * @return Specificity value of the expression for the supplied profile set. */ public double getSpecificity(ProfileSet profileSet) { double specificity = 0; // Only if the expression matches the device. if(isMatch(profileSet)) { for (int i = 0; i < expressionTokens.length; i++) { if(expressionTokens[i].isMatch(profileSet)) { specificity += expressionTokens[i].getSpecificity(profileSet); } } } return specificity; }
/** * Get the specificity of this expression with respect to the supplied profile set. * <p/> * Iterates over this expressions list of {@link ExpressionToken}s calling * {@link ExpressionToken#getSpecificity(org.milyn.profile.ProfileSet)} and adds up their specificities. * @param profileSet Evaluation Profile Set. * @return Specificity value of the expression for the supplied profile set. */ public double getSpecificity(ProfileSet profileSet) { double specificity = 0; // Only if the expression matches the device. if(isMatch(profileSet)) { for (int i = 0; i < expressionTokens.length; i++) { if(expressionTokens[i].isMatch(profileSet)) { specificity += expressionTokens[i].getSpecificity(profileSet); } } } return specificity; }
/** * Get the specificity of this expression with respect to the supplied profile set. * * Iterates over this expressions list of {@link ExpressionToken}s calling * {@link ExpressionToken#getSpecificity(org.milyn.profile.ProfileSet)} and adds up their specificities. * @param profileSet Evaluation Profile Set. * @return Specificity value of the expression for the supplied profile set. */ public double getSpecificity(ProfileSet profileSet) { double specificity = 0; // Only if the expression matches the device. if(isMatch(profileSet)) { for (int i = 0; i < expressionTokens.length; i++) { if(expressionTokens[i].isMatch(profileSet)) { specificity += expressionTokens[i].getSpecificity(profileSet); } } } return specificity; }
/** * Get all SmooksResourceConfiguration entries targeted at the specified profile set. * @param profileSet The profile set to searh against. * @return All SmooksResourceConfiguration entries targeted at the specified profile set. */ public SmooksResourceConfiguration[] getTargetConfigurations(ProfileSet profileSet) { Vector<SmooksResourceConfiguration> matchingSmooksResourceConfigurationsColl = new Vector<SmooksResourceConfiguration>(); SmooksResourceConfiguration[] matchingSmooksResourceConfigurations; // Iterate over the SmooksResourceConfigurations defined on this list. for(int i = 0; i < size(); i++) { SmooksResourceConfiguration resourceConfig = get(i); ProfileTargetingExpression[] profileTargetingExpressions = resourceConfig.getProfileTargetingExpressions(); for(int expIndex = 0; expIndex < profileTargetingExpressions.length; expIndex++) { ProfileTargetingExpression expression = profileTargetingExpressions[expIndex]; if(expression.isMatch(profileSet)) { matchingSmooksResourceConfigurationsColl.addElement(resourceConfig); break; } else { logger.debug("Resource [" + resourceConfig + "] not targeted at profile [" + profileSet.getBaseProfile() + "]. Sub Profiles: [" + profileSet + "]"); } } } matchingSmooksResourceConfigurations = new SmooksResourceConfiguration[matchingSmooksResourceConfigurationsColl.size()]; matchingSmooksResourceConfigurationsColl.toArray(matchingSmooksResourceConfigurations); return matchingSmooksResourceConfigurations; }
/** * Get all SmooksResourceConfiguration entries targeted at the specified profile set. * @param profileSet The profile set to searh against. * @return All SmooksResourceConfiguration entries targeted at the specified profile set. */ public SmooksResourceConfiguration[] getTargetConfigurations(ProfileSet profileSet) { Vector<SmooksResourceConfiguration> matchingSmooksResourceConfigurationsColl = new Vector<SmooksResourceConfiguration>(); SmooksResourceConfiguration[] matchingSmooksResourceConfigurations; // Iterate over the SmooksResourceConfigurations defined on this list. for(int i = 0; i < size(); i++) { SmooksResourceConfiguration resourceConfig = get(i); ProfileTargetingExpression[] profileTargetingExpressions = resourceConfig.getProfileTargetingExpressions(); for(int expIndex = 0; expIndex < profileTargetingExpressions.length; expIndex++) { ProfileTargetingExpression expression = profileTargetingExpressions[expIndex]; if(expression.isMatch(profileSet)) { matchingSmooksResourceConfigurationsColl.addElement(resourceConfig); break; } else { logger.debug("Resource [" + resourceConfig + "] not targeted at profile [" + profileSet.getBaseProfile() + "]. Sub Profiles: [" + profileSet + "]"); } } } matchingSmooksResourceConfigurations = new SmooksResourceConfiguration[matchingSmooksResourceConfigurationsColl.size()]; matchingSmooksResourceConfigurationsColl.toArray(matchingSmooksResourceConfigurations); return matchingSmooksResourceConfigurations; }
/** * Get all SmooksResourceConfiguration entries targeted at the specified profile set. * @param profileSet The profile set to searh against. * @return All SmooksResourceConfiguration entries targeted at the specified profile set. */ public SmooksResourceConfiguration[] getTargetConfigurations(ProfileSet profileSet) { Vector<SmooksResourceConfiguration> matchingSmooksResourceConfigurationsColl = new Vector<SmooksResourceConfiguration>(); SmooksResourceConfiguration[] matchingSmooksResourceConfigurations; // Iterate over the SmooksResourceConfigurations defined on this list. for(int i = 0; i < size(); i++) { SmooksResourceConfiguration resourceConfig = get(i); ProfileTargetingExpression[] profileTargetingExpressions = resourceConfig.getProfileTargetingExpressions(); for(int expIndex = 0; expIndex < profileTargetingExpressions.length; expIndex++) { ProfileTargetingExpression expression = profileTargetingExpressions[expIndex]; if(expression.isMatch(profileSet)) { matchingSmooksResourceConfigurationsColl.addElement(resourceConfig); break; } else { logger.debug("Resource [" + resourceConfig + "] not targeted at profile [" + profileSet.getBaseProfile() + "]. Sub Profiles: [" + profileSet + "]"); } } } matchingSmooksResourceConfigurations = new SmooksResourceConfiguration[matchingSmooksResourceConfigurationsColl.size()]; matchingSmooksResourceConfigurationsColl.toArray(matchingSmooksResourceConfigurations); return matchingSmooksResourceConfigurations; }