Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
0477bd12
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
0477bd12
编写于
12月 08, 2010
作者:
O
okutsu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6203034: [AC] AttributedCharacterIterator methods works wrong (run with respect differs from spec)
Reviewed-by: peytoia
上级
ebc7a297
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
35 addition
and
21 deletion
+35
-21
src/share/classes/java/text/AttributedCharacterIterator.java
src/share/classes/java/text/AttributedCharacterIterator.java
+35
-21
未找到文件。
src/share/classes/java/text/AttributedCharacterIterator.java
浏览文件 @
0477bd12
/*
* Copyright (c) 1997, 20
04
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 20
10
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -32,7 +32,7 @@ import java.util.Map;
import
java.util.Set
;
/**
* An
AttributedCharacterIterator
allows iteration through both text and
* An
{@code AttributedCharacterIterator}
allows iteration through both text and
* related attribute information.
*
* <p>
...
...
@@ -46,22 +46,28 @@ import java.util.Set;
* <p>A <em>run with respect to an attribute</em> is a maximum text range for
* which:
* <ul>
* <li>the attribute is undefined or
null
for the entire range, or
* <li>the attribute value is defined and has the same non-
null
value for the
* <li>the attribute is undefined or
{@code null}
for the entire range, or
* <li>the attribute value is defined and has the same non-
{@code null}
value for the
* entire range.
* </ul>
*
* <p>A <em>run with respect to a set of attributes</em> is a maximum text range for
* which this condition is met for each member attribute.
*
* <p>When getting a run with no explicit attributes specified (i.e.,
* calling {@link #getRunStart()} and {@link #getRunLimit()}), any
* contiguous text segments having the same attributes (the same set
* of attribute/value pairs) are treated as separate runs if the
* attributes have been given to those text segments separately.
*
* <p>The returned indexes are limited to the range of the iterator.
*
* <p>The returned attribute information is limited to runs that contain
* the current character.
*
* <p>
* Attribute keys are instances of
AttributedCharacterIterator.Attribute
and its
* subclasses, such as
java.awt.font.TextAttribute
.
* Attribute keys are instances of
{@link AttributedCharacterIterator.Attribute}
and its
* subclasses, such as
{@link java.awt.font.TextAttribute}
.
*
* @see AttributedCharacterIterator.Attribute
* @see java.awt.font.TextAttribute
...
...
@@ -74,7 +80,7 @@ public interface AttributedCharacterIterator extends CharacterIterator {
/**
* Defines attribute keys that are used to identify text attributes. These
* keys are used in
AttributedCharacterIterator and AttributedString
.
* keys are used in
{@code AttributedCharacterIterator} and {@code AttributedString}
.
* @see AttributedCharacterIterator
* @see AttributedString
* @since 1.2
...
...
@@ -83,7 +89,7 @@ public interface AttributedCharacterIterator extends CharacterIterator {
public
static
class
Attribute
implements
Serializable
{
/**
* The name of this
Attribute. The name is used primarily by readResolve
* The name of this
{@code Attribute}. The name is used primarily by {@code readResolve}
* to look up the corresponding predefined instance when deserializing
* an instance.
* @serial
...
...
@@ -94,7 +100,7 @@ public interface AttributedCharacterIterator extends CharacterIterator {
private
static
final
Map
instanceMap
=
new
HashMap
(
7
);
/**
* Constructs an
Attribute
with the given name.
* Constructs an
{@code Attribute}
with the given name.
*/
protected
Attribute
(
String
name
)
{
this
.
name
=
name
;
...
...
@@ -114,7 +120,7 @@ public interface AttributedCharacterIterator extends CharacterIterator {
/**
* Returns a hash code value for the object. This version is identical to
* the one in
Object
, but is also final.
* the one in
{@code Object}
, but is also final.
*/
public
final
int
hashCode
()
{
return
super
.
hashCode
();
...
...
@@ -122,7 +128,8 @@ public interface AttributedCharacterIterator extends CharacterIterator {
/**
* Returns a string representation of the object. This version returns the
* concatenation of class name, "(", a name identifying the attribute and ")".
* concatenation of class name, {@code "("}, a name identifying the attribute
* and {@code ")"}.
*/
public
String
toString
()
{
return
getClass
().
getName
()
+
"("
+
name
+
")"
;
...
...
@@ -153,7 +160,7 @@ public interface AttributedCharacterIterator extends CharacterIterator {
/**
* Attribute key for the language of some text.
* <p> Values are instances of
Locale
.
* <p> Values are instances of
{@link java.util.Locale Locale}
.
* @see java.util.Locale
*/
public
static
final
Attribute
LANGUAGE
=
new
Attribute
(
"language"
);
...
...
@@ -163,7 +170,7 @@ public interface AttributedCharacterIterator extends CharacterIterator {
* and the pronunciation of a word are only loosely related (such as Japanese),
* it is often necessary to store the reading (pronunciation) along with the
* written form.
* <p>Values are instances of
Annotation holding instances of String
.
* <p>Values are instances of
{@link Annotation} holding instances of {@link String}
.
* @see Annotation
* @see java.lang.String
*/
...
...
@@ -172,7 +179,7 @@ public interface AttributedCharacterIterator extends CharacterIterator {
/**
* Attribute key for input method segments. Input methods often break
* up text into segments, which usually correspond to words.
* <p>Values are instances of
Annotation holding a null
reference.
* <p>Values are instances of
{@link Annotation} holding a {@code null}
reference.
* @see Annotation
*/
public
static
final
Attribute
INPUT_METHOD_SEGMENT
=
new
Attribute
(
"input_method_segment"
);
...
...
@@ -185,36 +192,44 @@ public interface AttributedCharacterIterator extends CharacterIterator {
/**
* Returns the index of the first character of the run
* with respect to all attributes containing the current character.
*
* <p>Any contiguous text segments having the same attributes (the
* same set of attribute/value pairs) are treated as separate runs
* if the attributes have been given to those text segments separately.
*/
public
int
getRunStart
();
/**
* Returns the index of the first character of the run
* with respect to the given
attribute
containing the current character.
* with respect to the given
{@code attribute}
containing the current character.
*/
public
int
getRunStart
(
Attribute
attribute
);
/**
* Returns the index of the first character of the run
* with respect to the given
attributes
containing the current character.
* with respect to the given
{@code attributes}
containing the current character.
*/
public
int
getRunStart
(
Set
<?
extends
Attribute
>
attributes
);
/**
* Returns the index of the first character following the run
* with respect to all attributes containing the current character.
*
* <p>Any contiguous text segments having the same attributes (the
* same set of attribute/value pairs) are treated as separate runs
* if the attributes have been given to those text segments separately.
*/
public
int
getRunLimit
();
/**
* Returns the index of the first character following the run
* with respect to the given
attribute
containing the current character.
* with respect to the given
{@code attribute}
containing the current character.
*/
public
int
getRunLimit
(
Attribute
attribute
);
/**
* Returns the index of the first character following the run
* with respect to the given
attributes
containing the current character.
* with respect to the given
{@code attributes}
containing the current character.
*/
public
int
getRunLimit
(
Set
<?
extends
Attribute
>
attributes
);
...
...
@@ -225,9 +240,8 @@ public interface AttributedCharacterIterator extends CharacterIterator {
public
Map
<
Attribute
,
Object
>
getAttributes
();
/**
* Returns the value of the named attribute for the current character.
* Returns null if the attribute is not defined.
* @param attribute the key of the attribute whose value is requested.
* Returns the value of the named {@code attribute} for the current character.
* Returns {@code null} if the {@code attribute} is not defined.
*/
public
Object
getAttribute
(
Attribute
attribute
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录