98 lines
4.1 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="header">
<div class="subTitle">
javax.swing.text
</div>
<h2 class="title" title="Interface Position">Interface Position</h2>
</div><div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr/> <br/> <pre>public interface <span class="typeNameLabel">Position</span></pre>
<div class="block">
<span>表示文档中的位置。</span>
<span>它旨在抽象出文档的实现细节,并且能够在文档中编辑能够跟踪变化的文档中的位置的指定。</span>
<p> <span>一个<code>Position</code>对象指向两个字符之间的位置。</span> <span>随着周围内容的改变, <code>Position</code>对象自动调整其偏移量以反映更改。</span> <span>如果在<code>Position</code>对象的位置之前插入或删除了内容,那么<code>Position</code>分别递增或递减其偏移量,以指向相同的位置。</span> <span>如果删除了包含<code>Position</code>的偏移量的文档的一部分,则<code>Position</code>的偏移量将变为已移除区域的开始位置。</span> <span>例如,如果<code>Position</code>的偏移量为5而区域2-10被移除<code>Position</code>的偏移量为2。</span> </p>
<p> <span>偏移量为0的<code>Position</code>是一种特殊情况。</span> <span>它在文档内容被更改时从不改变其偏移量。</span> </p>
</div> </li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- --> </a> <h3>Nested Class Summary</h3>
<table border="0" cellpadding="3" cellspacing="0" class="memberSummary" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption>
<span>Nested Classes</span>
<span class="tabEnd"> </span>
</caption>
<tbody>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Interface and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/text/Position.Bias.html" title="class in javax.swing.text">Position.Bias</a></span></code>
<div class="block">
一种类型安全的枚举,用于指示模型中位置的偏差。
</div> </td>
</tr>
</tbody>
</table> </li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- --> </a> <h3>方法摘要</h3>
<table border="0" cellpadding="3" cellspacing="0" class="memberSummary" summary="Method Summary table, listing methods, and an explanation">
<caption>
<span class="activeTableTab" id="t0"><span>所有方法</span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t2"><span><a href="javascript:show(2);">接口方法</a></span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t3"><span><a href="javascript:show(4);">抽象方法</a></span><span class="tabEnd"> </span></span>
</caption>
<tbody>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor" id="i0">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/text/Position.html#getOffset--">getOffset</a></span>()</code>
<div class="block">
获取文档中的当前偏移量。
</div> </td>
</tr>
</tbody>
</table> </li>
</ul> </li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- --> </a> <h3>方法详细信息</h3> <a name="getOffset--">
<!-- --> </a>
<ul class="blockListLast">
<li class="blockList"> <h4>getOffset</h4> <pre>int getOffset()</pre>
<div class="block">
获取文档中的当前偏移量。
</div>
<dl>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
offset&gt; = 0
</dd>
</dl> </li>
</ul> </li>
</ul> </li>
</ul>
</div>
</div>