Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.deft.extension.tools.astlayouter
Class TokenLine

    java.lang.Object
      org.deft.extension.tools.astlayouter.TokenLine

All Implemented Interfaces:
  java.lang.Iterable<org.deft.repository.ast.Token>

    public class TokenLine

extends java.lang.Object
implements java.lang.Iterable<org.deft.repository.ast.Token>

Representation of tokens of the AST in one line.

Author:
  Martin Heinzerling

Constructor Summary
`TokenLine(int line)`

Method Summary
`void` | `addToken(org.deft.repository.ast.Token t)`
`int` | `getCol()`
`int` | `getEndCol()`
`int` | `getEndLine()`
`int` | `getEndOffset()`
`org.deft.repository.ast.Token` | `getFirstToken()`
`org.deft.repository.ast.Token` | `getLastToken()`
`int` | `getLine()`
`org.deft.repository.ast.Token` | `getNextToken(org.deft.repository.ast.Token t)` Not for iteration!!!!
`int` | `getOffset()`
`org.deft.repository.ast.Token` | `getPreviousToken(org.deft.repository.ast.Token t)` Not for iteration!!!!
`org.deft.repository.ast.Token` | `getTokenAtIndex(int i)`
`int` | `indexOf(org.deft.repository.ast.Token t)`
`java.util.Iterator<org.deft.repository.ast.Token>` | `iterator()`
`void` | `moveCol(int startIndex, int offset)` Relative move in a line, starting at a given token index.
`void` | `moveLine(int offset)` Relative move of the whole line.
`int` | `size()`
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### TokenLine

    public TokenLine(int line)

Method Detail

### addToken

    public void addToken(org.deft.repository.ast.Token t)

  Parameters:
    `t` - Token

### moveCol

    public void moveCol(int startIndex,
                        int offset)

  Relative move in a line, starting at a given token index.

  Parameters:
    `startIndex` - start token index
    `offset` - relative movement

### moveLine

    public void moveLine(int offset)

  Relative move of the whole line.

  Parameters:
    `offset` - relative movement

### iterator

    public java.util.Iterator<org.deft.repository.ast.Token> iterator()

  Specified by:
    `iterator` in interface `java.lang.Iterable<org.deft.repository.ast.Token>`

### indexOf

    public int indexOf(org.deft.repository.ast.Token t)

  Parameters:
    `t` - Token
  Returns:
    index

### getTokenAtIndex

    public org.deft.repository.ast.Token getTokenAtIndex(int i)

  Parameters:
    `i` - index
  Returns:
    Token

### getFirstToken

    public org.deft.repository.ast.Token getFirstToken()

  Returns:
    Token or null

### getLastToken

    public org.deft.repository.ast.Token getLastToken()

### getPreviousToken

    public org.deft.repository.ast.Token getPreviousToken(org.deft.repository.ast.Token t)

  Not for iteration!!!!

  Parameters:
    `t` - Token
  Returns:
    Token or null

### getNextToken

    public org.deft.repository.ast.Token getNextToken(org.deft.repository.ast.Token t)

  Not for iteration!!!!

  Parameters:
    `t` - Token
  Returns:
    Token or null

### getLine

    public int getLine()

### getCol

    public int getCol()

### getOffset

    public int getOffset()

  Returns:
    First offset of line

### getEndLine

    public int getEndLine()

### getEndCol

    public int getEndCol()

### getEndOffset

    public int getEndOffset()

  Returns:
    EOL offset

### size

    public int size()

  Returns:
    tokens in line

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD