/** * Read the informations contains in the PrjElement in parameter if it is a * PrjNumberParameter and put it into the set of parameters. * * @param e the PrjElement to parse * @param name the key to use to put the string in the Map of parameters */ private void parseNumber(PrjElement e, String name) { if (e instanceof PrjNumberElement) { PrjNumberElement n = (PrjNumberElement) e; params.put(name, String.valueOf(n.getValue())); } else { throw new PrjParserException("Failed to parse PRJ. Found '" + e + "', expected PrjNumberElement with " + name + " in it."); } }
/** * Return the informations contains in the PrjElement in parameter if it is * a PrjNumberParameter. * * @param e the PrjElement to parse */ private double getNumber(PrjElement e) { if (e instanceof PrjNumberElement) { PrjNumberElement n = (PrjNumberElement) e; return n.getValue(); } else { throw new PrjParserException("Failed to parse PRJ. Found '" + e + "', expected PrjNumberElement."); } } }