< prev index next >

src/jdk.compiler/share/classes/com/sun/source/util/SourcePositions.java

Print this page

 57      */
 58     @Deprecated(since = "27", forRemoval = true)
 59     default long getStartPosition(CompilationUnitTree file, Tree tree) {
 60         return getStartPosition(tree);
 61     }
 62 
 63     /**
 64      * {@return the starting position of the given {@link Tree}, or if the starting position is not available, returns
 65      * {@link javax.tools.Diagnostic#NOPOS}}
 66      *
 67      * <p>The returned position must be at the start of the yield of this tree, that is for any sub-tree of this tree,
 68      * the following must hold:
 69      *
 70      * <p>
 71      * {@code getStartPosition(tree) <= getStartPosition(subtree)} or <br>
 72      * {@code getStartPosition(tree) == NOPOS} or <br>
 73      * {@code getStartPosition(subtree) == NOPOS}
 74      * </p>
 75      *
 76      * @param tree tree for which a position is sought

 77      */
 78      long getStartPosition(Tree tree);
 79 
 80     /**
 81      * Returns the ending position of tree within file.  If tree is not found within
 82      * file, or if the ending position is not available,
 83      * returns {@link javax.tools.Diagnostic#NOPOS}.
 84      * The returned position must be at the end of the yield of this tree,
 85      * that is for any sub-tree of this tree, the following must hold:
 86      *
 87      * <p>
 88      * {@code getEndPosition(file, tree) >= getEndPosition(file, subtree)} or <br>
 89      * {@code getEndPosition(file, tree) == NOPOS} or <br>
 90      * {@code getEndPosition(file, subtree) == NOPOS}
 91      * </p>
 92      *
 93      * In addition, the following must hold:
 94      *
 95      * <p>
 96      * {@code getStartPosition(file, tree) <= getEndPosition(file, tree)} or <br>

113      * returns {@link javax.tools.Diagnostic#NOPOS}}
114      *
115      * <p>The returned position must be at the end of the yield of this tree, that is for any sub-tree of this tree,
116      * the following must hold:
117      *
118      * <p>
119      * {@code getEndPosition(tree) >= getEndPosition(subtree)} or <br>
120      * {@code getEndPosition(tree) == NOPOS} or <br>
121      * {@code getEndPosition(subtree) == NOPOS}
122      * </p>
123      *
124      * In addition, the following must hold:
125      *
126      * <p>
127      * {@code getStartPosition(tree) <= getEndPosition(tree)} or <br>
128      * {@code getStartPosition(tree) == NOPOS} or <br>
129      * {@code getEndPosition(tree) == NOPOS}
130      * </p>
131      *
132      * @param tree tree for which a position is sought

133      */
134     long getEndPosition(Tree tree);
135 }

 57      */
 58     @Deprecated(since = "27", forRemoval = true)
 59     default long getStartPosition(CompilationUnitTree file, Tree tree) {
 60         return getStartPosition(tree);
 61     }
 62 
 63     /**
 64      * {@return the starting position of the given {@link Tree}, or if the starting position is not available, returns
 65      * {@link javax.tools.Diagnostic#NOPOS}}
 66      *
 67      * <p>The returned position must be at the start of the yield of this tree, that is for any sub-tree of this tree,
 68      * the following must hold:
 69      *
 70      * <p>
 71      * {@code getStartPosition(tree) <= getStartPosition(subtree)} or <br>
 72      * {@code getStartPosition(tree) == NOPOS} or <br>
 73      * {@code getStartPosition(subtree) == NOPOS}
 74      * </p>
 75      *
 76      * @param tree tree for which a position is sought
 77      * @since 27
 78      */
 79      long getStartPosition(Tree tree);
 80 
 81     /**
 82      * Returns the ending position of tree within file.  If tree is not found within
 83      * file, or if the ending position is not available,
 84      * returns {@link javax.tools.Diagnostic#NOPOS}.
 85      * The returned position must be at the end of the yield of this tree,
 86      * that is for any sub-tree of this tree, the following must hold:
 87      *
 88      * <p>
 89      * {@code getEndPosition(file, tree) >= getEndPosition(file, subtree)} or <br>
 90      * {@code getEndPosition(file, tree) == NOPOS} or <br>
 91      * {@code getEndPosition(file, subtree) == NOPOS}
 92      * </p>
 93      *
 94      * In addition, the following must hold:
 95      *
 96      * <p>
 97      * {@code getStartPosition(file, tree) <= getEndPosition(file, tree)} or <br>

114      * returns {@link javax.tools.Diagnostic#NOPOS}}
115      *
116      * <p>The returned position must be at the end of the yield of this tree, that is for any sub-tree of this tree,
117      * the following must hold:
118      *
119      * <p>
120      * {@code getEndPosition(tree) >= getEndPosition(subtree)} or <br>
121      * {@code getEndPosition(tree) == NOPOS} or <br>
122      * {@code getEndPosition(subtree) == NOPOS}
123      * </p>
124      *
125      * In addition, the following must hold:
126      *
127      * <p>
128      * {@code getStartPosition(tree) <= getEndPosition(tree)} or <br>
129      * {@code getStartPosition(tree) == NOPOS} or <br>
130      * {@code getEndPosition(tree) == NOPOS}
131      * </p>
132      *
133      * @param tree tree for which a position is sought
134      * @since 27
135      */
136     long getEndPosition(Tree tree);
137 }
< prev index next >