code: private void pushText() {
      if (buf.length() > 0) {
        nodes.add(new NumberPattern.Text(buf.toString()));
        buf.setLength(0);
      }
    }
docs: If the buffer is not empty, push it onto the node list and reset it.