/** * Returns a Percent instance representing the specified String value * * @param stringValue * a String value * @return return a Percent instance representing stringValue * @throws IllegalArgumentException if the given argument is not a valid Percent */ public static Percent valueOf(String stringValue) throws IllegalArgumentException { if ((stringValue == null) || (stringValue.length() == 0)) { return new Percent(0.0); } int n = stringValue.indexOf("%"); if (n != -1) { return new Percent(Double.valueOf(stringValue.substring(0, n)).doubleValue() / 100); } else { throw new IllegalArgumentException("parameter is invalid for datatype Percent"); } }
/** * Get the width of a footnote separator line. * <p> * If there is no <code>style:footnote-sep</code> element, the default value * 0 will be returned. * * @return the width a footnote separator line. */ public double getFootnoteSepWidth() { if (mFootnoteSepElement == null) { return 0; } else { String value = mFootnoteSepElement.getStyleRelWidthAttribute(); if (value == null) value = DEFAULT_PERCENT; return Percent.valueOf(value).doubleValue(); } }
.getQName()); } else { mFootnoteSepElement.setStyleRelWidthAttribute(width.toString());
.getQName()); } else { mFootnoteSepElement.setStyleRelWidthAttribute(width.toString());
/** * Returns a Percent instance representing the specified String value * * @param stringValue * a String value * @return return a Percent instance representing stringValue * @throws IllegalArgumentException if the given argument is not a valid Percent */ public static Percent valueOf(String stringValue) throws IllegalArgumentException { if ((stringValue == null) || (stringValue.length() == 0)) { return new Percent(0.0); } int n = stringValue.indexOf("%"); if (n != -1) { return new Percent(Double.valueOf(stringValue.substring(0, n)).doubleValue() / 100); } else { throw new IllegalArgumentException("parameter is invalid for datatype Percent"); } }
/** * Get the width of a footnote separator line. * <p> * If there is no <code>style:footnote-sep</code> element, the default value * 0 will be returned. * * @return the width a footnote separator line. */ public double getFootnoteSepWidth() { if (mFootnoteSepElement == null) { return 0; } else { String value = mFootnoteSepElement.getStyleRelWidthAttribute(); if (value == null) value = DEFAULT_PERCENT; return Percent.valueOf(value).doubleValue(); } }
/** * Returns a Percent instance representing the specified String value * * @param stringValue * a String value * @return return a Percent instance representing stringValue * @throws IllegalArgumentException if the given argument is not a valid Percent */ public static Percent valueOf(String stringValue) throws IllegalArgumentException { if ((stringValue == null) || (stringValue.length() == 0)) { return new Percent(0.0); } int n = stringValue.indexOf("%"); if (n != -1) { return new Percent(Double.valueOf(stringValue.substring(0, n)).doubleValue() / 100); } else { throw new IllegalArgumentException("parameter is invalid for datatype Percent"); } }