|
Compiler Tree API | ||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
public interface SourcePositions
CompilationUnit 内の Tree の部分を取得するためのメソッドを提供します。位置は CompilationUnit の開始点からの単純な文字オフセットとして定義されます。最初の文字は、オフセット 0 になります。
メソッドの概要 | |
---|---|
long |
getEndPosition(CompilationUnitTree file,
Tree tree)
ファイル内のツリーの終了位置を取得します。 |
long |
getStartPosition(CompilationUnitTree file,
Tree tree)
ファイル内のツリーの開始位置を取得します。 |
メソッドの詳細 |
---|
long getStartPosition(CompilationUnitTree file, Tree tree)
Diagnostic.NOPOS
を返します。返される位置は、このツリーの開始点である必要があります。つまり、このツリーのサブツリーでは、次の状態を保持する必要があります。
tree.getStartPosition() <= subtree.getStartPosition()
または
tree.getStartPosition() == NOPOS
または
subtree.getStartPosition() == NOPOS
file
- ツリーが検索される CompilationUnittree
- 位置のシーク対象となるツリー
long getEndPosition(CompilationUnitTree file, Tree tree)
Diagnostic.NOPOS
を返します。返される位置は、このツリーの終了点である必要があります。つまり、このツリーのサブツリーでは、次の状態を保持する必要があります。
tree.getEndPosition() >= subtree.getEndPosition()
または
tree.getEndPosition() == NOPOS
または
subtree.getEndPosition() == NOPOS
tree.getStartPosition() <= tree.getEndPosition()
または
tree.getStartPosition() == NOPOS
または
tree.getEndPosition() == NOPOS
file
- ツリーが検索される CompilationUnittree
- 位置のシーク対象となるツリー
|
Compiler Tree API | ||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |