code: public int getColumnNumber(int pos, boolean expandTabs) {
          try {
              if (findLine(pos)) {
                  int column = 0;
                  for (int bp = lineStart; bp < pos; bp++) {
                      if (bp >= bufLen) {
                          return 0;
                      }
                      if (buf[bp] == '\t' && expandTabs) {
                          column = (column / TabInc * TabInc) + TabInc;
                      } else {
                          column++;
                      }
                  }
                  return column + 1; // positions are one-based
              }
              return 0;
          } finally {
              buf = null;
          }
      }
docs: Return the one-based column number associated with a given pos
  for the current source file.  Zero is returned if no column exists
  for the given position.