Convert a cell position string like B3 to the column number.

@param pos The cell position in the range 'A1' to 'IV65536'
@return The row, e.g. A1 will return 0, B1 will return 1, E1 will return
4
170844
public Position getPosition(final String pos) {
        final String s = pos.toUpperCase(Locale.US);
        final int len = s.length();
        int status = 0;

        int row = 0;
        int col = 0;
        int n = 0;
        while (n < len) {
            final char c = s.charAt(n);
            switch (status) {
                case BEGIN_LETTER: // opt $
                case BEGIN_DIGIT: // opt $
                    status++;
                    if (c == '$') n++;
                    break;
                case FIRST_LETTER: // mand letter
                    if ('A' <= c && c <= 'Z') {
                        col = c - 'A' + 1;
                        status = PositionUtil.OPT_SECOND_LETTER;
                        n++;
                    } else return null;
                    break;
                case OPT_SECOND_LETTER: // opt letter
                    if ('A' <= c && c <= 'Z') {
                        col = col * ALPHABET_SIZE + c - ORD_A + 1;
                        n++;
                    }
                    status = PositionUtil.BEGIN_DIGIT;
                    break;
                case FIRST_DIGIT: // mand digit
                    if ('0' <= c && c <= '9') {
                        row = c - '0';
                        status = PositionUtil.OPT_DIGIT;
                        n++;
                    } else return null;
                    break;
                case OPT_DIGIT: // opt digit
                    if ('0' <= c && c <= '9') {
                        row = row * 10 + c - '0';
                        n++;
                    } else return null;
                    break;
                default:
                    return null;
            }
        }
        return new Position(this.equalityUtil, this.tableNameUtil, row - 1, col - 1);
    }
483771
public final BigInteger getBeUlong64(final int pos) {
        final long long64 = getBeLong64(pos);

        return (long64 >= 0) ? BigInteger.valueOf(long64) : BIGINT_MAX_VALUE.add(BigInteger.valueOf(1 + long64));
    }
524258
public function getValuesForPosition($pos) {
        $arr = array();
        foreach ($this->rows as $key => $row) {
            $arr[$key] = $row->getValueForPosition($pos);
        }
        return $arr;
    }
1110871
public function getValueForPosition($pos) {
        return (isset($this->cells[$pos])) ? $this->cells[$pos]->getValue(): null;
    }
228983
private void writeUShort(int pos, int s) {
        byte b1 = (byte)((s >> 8) & 0xff);
        byte b2 = (byte)(s & 0xff);
        output[pos] = b1;
        output[pos + 1] = b2;
    }
550582
public static boolean isDigitAt(String s, int pos) {
    return pos > 0 && pos < s.length() && Character.isDigit(s.charAt(pos));
  }
505900
function positionRectangleInsideAnother(pos, a, b) {
    var aWidth = a.x2 - a.x1;
    var aHeight = a.y2 - a.y1;

    var bWidth = b.x2 - b.x1;
    var bHeight = b.y2 - b.y1;

    if (bHeight <= aHeight || bWidth <= aWidth) {
        return a;
    }

    var adjusted;
    switch (pos) {
        case "center":
            return {
                x1: a.x1 + (bWidth - aWidth)/2,
                x2: a.x2 + (bWidth - aWidth)/2,
                y1: a.y1 + (bHeight - aHeight)/2,
                y2: a.y2 + (bHeight - aHeight)/2
            };
        case "ne":
            return {
                x1: a.x1 + (bWidth - aWidth),
                x2: a.x2 + (bWidth - aWidth),
                y1: a.y1,
                y2: a.y2
            };
        case "se":
            return {
                x1: a.x1 + (bWidth - aWidth),
                x2: a.x2 + (bWidth - aWidth),
                y1: a.y1 + (bHeight - aHeight),
                y2: a.y2 + (bHeight - aHeight)
            };
        case "sw":
            return {
                x1: a.x1,
                x2: a.x2,
                y1: a.y1 + (bHeight - aHeight),
                y2: a.y2 + (bHeight - aHeight)
            };
        case "nw":
        default:
            return a;
    }

    return {}
}
1325290
function(pos) {
      if (posLess(pos, change.from)) return pos;
      if (!posLess(change.to, pos)) return end;

      var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;
      if (pos.line == change.to.line) ch += end.ch - change.to.ch;
      return Pos(line, ch);
    }
504194
def current_column(target=pos)
      if c = string.rindex("\n", target-1)
        return target - c - 1
      end

      target + 1
    end
625000
def get_table_pos(self, tablename):
        
        _table, (row, col) = self.__tables[tablename]
        return (row, col)
1012209
public TableRow getRow(final Table table, final TableAppender appender, final String pos)
            throws FastOdsException, IOException {
        final int row = this.positionUtil.getPosition(pos).getRow();
        return this.getRow(table, appender, row);
    }
679110
def cell_to_rowcol(cell)
    cell =~ /(\$?)([A-I]?[A-Z])(\$?)(\d+)/

    col_rel = $1 == "" ? 1 : 0
    row_rel = $3 == "" ? 1 : 0
    row     = $4.to_i

    col = chars_to_col($2.split(//))

    # Convert 1-index to zero-index
    row -= 1
    col -= 1

    [row, col, row_rel, col_rel]
  end
812807
function (pos) {
            if (pos === undefined) {
                pos = this.position;
            }
            var lines = this.source.substring(0, pos).split(/\r?\n/),
                row = lines.length,
                col = lines.pop().length + 1,
                allLines = this.source.split(/\r?\n/),
                source = [];
            for (var i = -2; i < 2; i++) {
                if (allLines[row + i]) {
                    source.push({
                        row: row + i + 1,
                        code: allLines[row + i]
                    })
                }
            }
            return {
                row: row,
                col: col,
                source: source
            }
        }
485845
public void putInt(int pos, int i) {
		adaptSize(pos + 4);
		ByteBuffer bb = getBuffer(pos);
		int index = pos % _bufferSize;
		if (bb.limit() - index >= 4) {
			bb.putInt(index, i);
		} else {
			byte b0 = (byte)i;
			byte b1 = (byte)(i >> 8);
			byte b2 = (byte)(i >> 16);
			byte b3 = (byte)(i >> 24);
			
			if (_order == ByteOrder.BIG_ENDIAN) {
				putBytes(pos, b3, b2, b1, b0);
			} else {
				putBytes(pos, b0, b1, b2, b3);
			}
		}
	}
140435
def coord_to_col( self, pos ):
        
        start,end = self.get_forward_strand_start(),self.get_forward_strand_end()
        if pos < start or pos > end:
            raise ValueError("Range error: %d not in %d-%d" % ( pos, start, end ))
        if not self.index:
            self.index = list()
            if (self.strand == '-'):
                # nota bene: for - strand self.index[x] maps to one column
                # higher than is actually associated with the position;  thus
                # when slice_by_component() and slice_by_coord() flip the ends,
                # the resulting slice is correct
                for x in range( len(self.text)-1,-1,-1 ):
                    if not self.text[x] == '-':
                        self.index.append( x + 1 )
                self.index.append( 0 )
            else:
                for x in range( len(self.text) ):
                    if not self.text[x] == '-':
                        self.index.append(x)
                self.index.append( len(self.text) )
        x = None
        try:
            x = self.index[ pos - start ]
        except:
            raise Exception("Error in index.")
        return x
1064479
def getCumPos(data):
    
    pos = getPosNew(data)
    chrom= data.geno['col_header']['chrom'][:]
    n_chroms = int(chrom.max())
    x = 0
    for chrom_i in range(1,n_chroms+1):
        I = chrom==chrom_i
        pos[I]+=x
        x=pos[I].max()
    return pos
1030020
public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
                break;
            case 1:
                return $this->getPersonId();
                break;
            case 2:
                return $this->getFunctionId();
                break;
            case 3:
                return $this->getCreatedAt();
                break;
            case 4:
                return $this->getUpdatedAt();
                break;
            case 5:
                return $this->getVersion();
                break;
            case 6:
                return $this->getVersionCreatedAt();
                break;
            case 7:
                return $this->getVersionCreatedBy();
                break;
            case 8:
                return $this->getPersonIdVersion();
                break;
            case 9:
                return $this->getFunctionIdVersion();
                break;
            default:
                return null;
                break;
        } // switch()
    }