private static CompiledScript compileScript(String name)
throws MalformedValueException {
int flagPos = name.indexOf(PERCENTAGE_FLAG);
if (flagPos <= 0)
throw new MalformedValueException
("PercentageFunction: '" + name + "' does not contain '" +
PERCENTAGE_FLAG + "'.");
String dataName = name.substring(flagPos + PERCENTAGE_FLAG.length());
String childPrefix = name.substring(0, flagPos);
String numeratorName = DataRepository.createDataName(childPrefix,
dataName);
int slashPos = childPrefix.lastIndexOf('/');
if (slashPos == -1)
throw new MalformedValueException
("PercentageFunction: '" + name + "' does not have a parent.");
String parentPrefix = name.substring(0, slashPos);
String denominatorName = DataRepository.createDataName(parentPrefix,
dataName);