Package org.odftoolkit.odfdom.dom.element.number

Examples of org.odftoolkit.odfdom.dom.element.number.NumberNumberElement


    return result;
  }

  private String getNumberFormat() {
    String result = "";
    NumberNumberElement number = OdfElement.findFirstChildNode(NumberNumberElement.class, this);
    boolean isGroup = number.getNumberGroupingAttribute();
    int decimalPos = (number.getNumberDecimalPlacesAttribute() == null) ? 0
        : number.getNumberDecimalPlacesAttribute().intValue();
    int minInt = (number.getNumberMinIntegerDigitsAttribute() == null) ? 1
        : number.getNumberMinIntegerDigitsAttribute().intValue();

    int i;
    for (i = 0; i < minInt; i++) {
      if (((i + 1) % 3) == 0 && isGroup) {
        result = ",0" + result;
View Full Code Here


    char ch;
    int nDigits;

    Pattern p = Pattern.compile("[#0,.]+");
    Matcher m;
    NumberNumberElement number;

    /*
     * If there is a numeric specification, then split the
     * string into the part before the specifier, the specifier
     * itself, and then part after the specifier. The parts
     * before and after are just text (which may contain the
     * currency symbol).
     */
    if (format != null && !format.equals("")) {
      m = p.matcher(format);
      if (m.find()) {
        preMatch = format.substring(0, m.start());
        numberSpec = format.substring(m.start(), m.end());
        postMatch = format.substring(m.end());

        emitText(preMatch);

        number = new NumberNumberElement((OdfFileDom) this.getOwnerDocument());

        /* Process part before the decimal point (if any) */
        nDigits = 0;
        for (pos = 0; pos < numberSpec.length()
            && (ch = numberSpec.charAt(pos)) != '.'; pos++) {
          if (ch == ',') {
            number.setNumberGroupingAttribute(new Boolean(true));
          } else if (ch == '0') {
            nDigits++;
          }
        }
        number.setNumberMinIntegerDigitsAttribute(nDigits);

        /* Number of decimal places is the length after the decimal */
        if (pos < numberSpec.length()) {
          number.setNumberDecimalPlacesAttribute(numberSpec.length() - (pos + 1));
        }
        if (pos == numberSpec.length()) {
          number.setNumberDecimalPlacesAttribute(0);
        }
        this.appendChild(number);

        emitText(postMatch);
      }
View Full Code Here

    return result;
  }

  public String getNumberFormat() {
    String result = "";
    NumberNumberElement number = OdfElement.findFirstChildNode(NumberNumberElement.class, this);
    boolean isGroup = number.getNumberGroupingAttribute();
    int decimalPos = (number.getNumberDecimalPlacesAttribute() == null) ? 0
        : number.getNumberDecimalPlacesAttribute().intValue();
    int minInt = (number.getNumberMinIntegerDigitsAttribute() == null) ? 1
        : number.getNumberMinIntegerDigitsAttribute().intValue();

    int i;
    for (i = 0; i < minInt; i++) {
      if (((i + 1) % 3) == 0 && isGroup) {
        result = ",0" + result;
View Full Code Here

    char ch;
    int nDigits;

    Pattern p = Pattern.compile("[#0,.]+");
    Matcher m;
    NumberNumberElement number;

    /*
     * If there is a numeric specifcation, then split the
     * string into the part before the specifier, the specifier
     * itself, and then part after the specifier. The parts
     * before and after are just text (which may contain the
     * currency symbol).
     */
    if (format != null && !format.equals("")) {
      m = p.matcher(format);
      if (m.find()) {
        preMatch = format.substring(0, m.start());
        numberSpec = format.substring(m.start(), m.end());
        postMatch = format.substring(m.end());

        emitText(preMatch);

        number = new NumberNumberElement((OdfFileDom) this.getOwnerDocument());

        /* Process part before the decimal point (if any) */
        nDigits = 0;
        for (pos = 0; pos < numberSpec.length()
            && (ch = numberSpec.charAt(pos)) != '.'; pos++) {
          if (ch == ',') {
            number.setNumberGroupingAttribute(new Boolean(true));
          } else if (ch == '0') {
            nDigits++;
          }
        }
        number.setNumberMinIntegerDigitsAttribute(nDigits);

        /* Number of decimal places is the length after the decimal */
        if (pos < numberSpec.length()) {
          number.setNumberDecimalPlacesAttribute(numberSpec.length() - (pos + 1));
        }
        this.appendChild(number);

        emitText(postMatch);
      }
View Full Code Here

    return result;
  }

  public String getNumberFormat() {
    String result = "";
    NumberNumberElement number = OdfElement.findFirstChildNode(NumberNumberElement.class, this);
    boolean isGroup = number.getNumberGroupingAttribute();
    int decimalPos = (number.getNumberDecimalPlacesAttribute() == null) ? 0
        : number.getNumberDecimalPlacesAttribute().intValue();
    int minInt = (number.getNumberMinIntegerDigitsAttribute() == null) ? 1
        : number.getNumberMinIntegerDigitsAttribute().intValue();

    int i;
    for (i = 0; i < minInt; i++) {
      if (((i + 1) % 3) == 0 && isGroup) {
        result = ",0" + result;
View Full Code Here

    char ch;
    int nDigits;

    Pattern p = Pattern.compile("[#0,.]+");
    Matcher m;
    NumberNumberElement number;

    /*
     * If there is a numeric specifcation, then split the
     * string into the part before the specifier, the specifier
     * itself, and then part after the specifier. The parts
     * before and after are just text (which may contain the
     * currency symbol).
     */
    m = p.matcher(format);
    if (m.find()) {
      preMatch = format.substring(0, m.start());
      numberSpec = format.substring(m.start(), m.end());
      postMatch = format.substring(m.end());

      processText(preMatch, currencySymbol);

      number = new NumberNumberElement((OdfFileDom) this.getOwnerDocument());

      /* Process part before the decimal point (if any) */
      nDigits = 0;
      for (pos = 0; pos < numberSpec.length()
          && (ch = numberSpec.charAt(pos)) != '.'; pos++) {
        if (ch == ',') {
          number.setNumberGroupingAttribute(new Boolean(true));
        } else if (ch == '0') {
          nDigits++;
        }
      }
      number.setNumberMinIntegerDigitsAttribute(nDigits);

      /* Number of decimal places is the length after the decimal */
      if (pos < numberSpec.length()) {
        number.setNumberDecimalPlacesAttribute(numberSpec.length() - (pos + 1));
      }
      this.appendChild(number);

      processText(postMatch, currencySymbol);
    }
View Full Code Here

    return result;
  }

  private String getNumberFormat() {
    String result = "";
    NumberNumberElement number = OdfElement.findFirstChildNode(NumberNumberElement.class, this);
    boolean isGroup = number.getNumberGroupingAttribute();
    int decimalPos = (number.getNumberDecimalPlacesAttribute() == null) ? 0
        : number.getNumberDecimalPlacesAttribute().intValue();
    int minInt = (number.getNumberMinIntegerDigitsAttribute() == null) ? 1
        : number.getNumberMinIntegerDigitsAttribute().intValue();

    int i;
    for (i = 0; i < minInt; i++) {
      if (((i + 1) % 3) == 0 && isGroup) {
        result = ",0" + result;
View Full Code Here

    char ch;
    int nDigits;

    Pattern p = Pattern.compile("[#0,.]+");
    Matcher m;
    NumberNumberElement number;

    /*
     * If there is a numeric specification, then split the
     * string into the part before the specifier, the specifier
     * itself, and then part after the specifier. The parts
     * before and after are just text (which may contain the
     * currency symbol).
     */
    if (format != null && !format.equals("")) {
      m = p.matcher(format);
      if (m.find()) {
        preMatch = format.substring(0, m.start());
        numberSpec = format.substring(m.start(), m.end());
        postMatch = format.substring(m.end());

        emitText(preMatch);

        number = new NumberNumberElement((OdfFileDom) this.getOwnerDocument());

        /* Process part before the decimal point (if any) */
        nDigits = 0;
        for (pos = 0; pos < numberSpec.length()
            && (ch = numberSpec.charAt(pos)) != '.'; pos++) {
          if (ch == ',') {
            number.setNumberGroupingAttribute(new Boolean(true));
          } else if (ch == '0') {
            nDigits++;
          }
        }
        number.setNumberMinIntegerDigitsAttribute(nDigits);

        /* Number of decimal places is the length after the decimal */
        if (pos < numberSpec.length()) {
          number.setNumberDecimalPlacesAttribute(numberSpec.length() - (pos + 1));
        }
        if (pos == numberSpec.length()) {
          number.setNumberDecimalPlacesAttribute(0);
        }
        this.appendChild(number);

        emitText(postMatch);
      }
View Full Code Here

    return result;
  }

  public String getNumberFormat() {
    String result = "";
    NumberNumberElement number = OdfElement.findFirstChildNode(NumberNumberElement.class, this);
    boolean isGroup = number.getNumberGroupingAttribute();
    int decimalPos = (number.getNumberDecimalPlacesAttribute() == null) ? 0
        : number.getNumberDecimalPlacesAttribute().intValue();
    int minInt = (number.getNumberMinIntegerDigitsAttribute() == null) ? 1
        : number.getNumberMinIntegerDigitsAttribute().intValue();

    int i;
    for (i = 0; i < minInt; i++) {
      if (((i + 1) % 3) == 0 && isGroup) {
        result = ",0" + result;
View Full Code Here

    char ch;
    int nDigits;

    Pattern p = Pattern.compile("[#0,.]+");
    Matcher m;
    NumberNumberElement number;

    /*
     * If there is a numeric specifcation, then split the
     * string into the part before the specifier, the specifier
     * itself, and then part after the specifier. The parts
     * before and after are just text (which may contain the
     * currency symbol).
     */
    if (format != null && !format.equals("")) {
      m = p.matcher(format);
      if (m.find()) {
        preMatch = format.substring(0, m.start());
        numberSpec = format.substring(m.start(), m.end());
        postMatch = format.substring(m.end());

        emitText(preMatch);

        number = new NumberNumberElement((OdfFileDom) this.getOwnerDocument());

        /* Process part before the decimal point (if any) */
        nDigits = 0;
        for (pos = 0; pos < numberSpec.length()
            && (ch = numberSpec.charAt(pos)) != '.'; pos++) {
          if (ch == ',') {
            number.setNumberGroupingAttribute(new Boolean(true));
          } else if (ch == '0') {
            nDigits++;
          }
        }
        number.setNumberMinIntegerDigitsAttribute(nDigits);

        /* Number of decimal places is the length after the decimal */
        if (pos < numberSpec.length()) {
          number.setNumberDecimalPlacesAttribute(numberSpec.length() - (pos + 1));
        }
        this.appendChild(number);

        emitText(postMatch);
      }
View Full Code Here

TOP

Related Classes of org.odftoolkit.odfdom.dom.element.number.NumberNumberElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.