getpos() public method

public getpos ( int pos ) : int
pos int
return int
Exemplo n.º 1
0
        public int position(int pos)
        {
            int n = lines;

            for (LineList p = list; p != null; p = p.tail, n--)
            {
                if (p.head < pos)
                {
                    return(p.getpos(pos));
                }
            }
            return(pos + 1);          // H Houh 4.3d
        }
Exemplo n.º 2
0
 public SourceLineInfo(LineManager lm, int pos)
 {
     lineNumber      = lm.lines;
     startOfLine     = 0;
     endOfLine       = lm.end;
     charPosition    = pos;
     rawCharPosition = pos;
     for (LineList p = lm.list; p != null; p = p.tail, lineNumber--)
     {
         if (p.head > pos)
         {
             endOfLine = p.head;
         }
         else
         {
             startOfLine     = p.head + 1;
             rawCharPosition = p.getpos(pos);
             charPosition    = pos - startOfLine + 1;
             break;
         }
     }
 }