public interface SourcePositions
修飾子と型 | メソッドと説明 |
---|---|
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
- ツリーが検索される CompilationUnit。tree
- 位置のシーク対象となるツリー。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
- ツリーが検索される CompilationUnit。tree
- 位置のシーク対象となるツリー。
Copyright © 2005, 2013, Oracle and/or its affiliates. All rights reserved.