Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
0d80ac64
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看板
提交
0d80ac64
编写于
8月 06, 2013
作者:
P
psandoz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8014824: Document Spliterator characteristics and binding policy of java util collection impls
Reviewed-by: chegar
上级
b06d15f5
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
165 addition
and
16 deletion
+165
-16
src/share/classes/java/util/ArrayDeque.java
src/share/classes/java/util/ArrayDeque.java
+13
-0
src/share/classes/java/util/ArrayList.java
src/share/classes/java/util/ArrayList.java
+14
-0
src/share/classes/java/util/HashSet.java
src/share/classes/java/util/HashSet.java
+12
-0
src/share/classes/java/util/LinkedHashMap.java
src/share/classes/java/util/LinkedHashMap.java
+10
-0
src/share/classes/java/util/LinkedHashSet.java
src/share/classes/java/util/LinkedHashSet.java
+15
-5
src/share/classes/java/util/LinkedList.java
src/share/classes/java/util/LinkedList.java
+17
-0
src/share/classes/java/util/List.java
src/share/classes/java/util/List.java
+1
-1
src/share/classes/java/util/PriorityQueue.java
src/share/classes/java/util/PriorityQueue.java
+13
-0
src/share/classes/java/util/Set.java
src/share/classes/java/util/Set.java
+1
-1
src/share/classes/java/util/SortedSet.java
src/share/classes/java/util/SortedSet.java
+1
-1
src/share/classes/java/util/Spliterator.java
src/share/classes/java/util/Spliterator.java
+5
-1
src/share/classes/java/util/TreeMap.java
src/share/classes/java/util/TreeMap.java
+31
-7
src/share/classes/java/util/TreeSet.java
src/share/classes/java/util/TreeSet.java
+19
-0
src/share/classes/java/util/Vector.java
src/share/classes/java/util/Vector.java
+13
-0
未找到文件。
src/share/classes/java/util/ArrayDeque.java
浏览文件 @
0d80ac64
...
...
@@ -888,6 +888,19 @@ public class ArrayDeque<E> extends AbstractCollection<E>
elements
[
i
]
=
s
.
readObject
();
}
/**
* Creates a <em><a href="Spliterator.html#binding">late-binding</a></em>
* and <em>fail-fast</em> {@link Spliterator} over the elements in this
* deque.
*
* <p>The {@code Spliterator} reports {@link Spliterator#SIZED},
* {@link Spliterator#SUBSIZED}, {@link Spliterator#ORDERED}, and
* {@link Spliterator#NONNULL}. Overriding implementations should document
* the reporting of additional characteristic values.
*
* @return a {@code Spliterator} over the elements in this deque
* @since 1.8
*/
public
Spliterator
<
E
>
spliterator
()
{
return
new
DeqSpliterator
<
E
>(
this
,
-
1
,
-
1
);
}
...
...
src/share/classes/java/util/ArrayList.java
浏览文件 @
0d80ac64
...
...
@@ -1238,6 +1238,20 @@ public class ArrayList<E> extends AbstractList<E>
}
}
/**
* Creates a <em><a href="Spliterator.html#binding">late-binding</a></em>
* and <em>fail-fast</em> {@link Spliterator} over the elements in this
* list.
*
* <p>The {@code Spliterator} reports {@link Spliterator#SIZED},
* {@link Spliterator#SUBSIZED}, and {@link Spliterator#ORDERED}.
* Overriding implementations should document the reporting of additional
* characteristic values.
*
* @return a {@code Spliterator} over the elements in this list
* @since 1.8
*/
@Override
public
Spliterator
<
E
>
spliterator
()
{
return
new
ArrayListSpliterator
<>(
this
,
0
,
-
1
,
0
);
}
...
...
src/share/classes/java/util/HashSet.java
浏览文件 @
0d80ac64
...
...
@@ -312,6 +312,18 @@ public class HashSet<E>
}
}
/**
* Creates a <em><a href="Spliterator.html#binding">late-binding</a></em>
* and <em>fail-fast</em> {@link Spliterator} over the elements in this
* set.
*
* <p>The {@code Spliterator} reports {@link Spliterator#SIZED} and
* {@link Spliterator#DISTINCT}. Overriding implementations should document
* the reporting of additional characteristic values.
*
* @return a {@code Spliterator} over the elements in this set
* @since 1.8
*/
public
Spliterator
<
E
>
spliterator
()
{
return
new
HashMap
.
KeySpliterator
<
E
,
Object
>(
map
,
0
,
-
1
,
0
,
0
);
}
...
...
src/share/classes/java/util/LinkedHashMap.java
浏览文件 @
0d80ac64
...
...
@@ -129,10 +129,20 @@ import java.util.function.BiFunction;
* exception for its correctness: <i>the fail-fast behavior of iterators
* should be used only to detect bugs.</i>
*
* <p>The spliterators returned by the spliterator method of the collections
* returned by all of this class's collection view methods are
* <em><a href="Spliterator.html#binding">late-binding</a></em>,
* <em>fail-fast</em>, and additionally report {@link Spliterator#ORDERED}.
*
* <p>This class is a member of the
* <a href="{@docRoot}/../technotes/guides/collections/index.html">
* Java Collections Framework</a>.
*
* @implNote
* The spliterators returned by the spliterator method of the collections
* returned by all of this class's collection view methods are created from
* the iterators of the corresponding collections.
*
* @param <K> the type of keys maintained by this map
* @param <V> the type of mapped values
*
...
...
src/share/classes/java/util/LinkedHashSet.java
浏览文件 @
0d80ac64
...
...
@@ -170,13 +170,23 @@ public class LinkedHashSet<E>
}
/**
* Creates a {@code Spliterator}, over the elements in this set, that
* reports {@code SIZED}, {@code DISTINCT} and {@code ORDERED}.
* Overriding implementations are expected to document if the
* {@code Spliterator} reports any additional and relevant characteristic
* values.
* Creates a <em><a href="Spliterator.html#binding">late-binding</a></em>
* and <em>fail-fast</em> {@code Spliterator} over the elements in this set.
*
* <p>The {@code Spliterator} reports {@link Spliterator#SIZED},
* {@link Spliterator#DISTINCT}, and {@code ORDERED}. Implementations
* should document the reporting of additional characteristic values.
*
* @implNote
* The implementation creates a
* <em><a href="Spliterator.html#binding">late-binding</a></em> spliterator
* from the set's {@code Iterator}. The spliterator inherits the
* <em>fail-fast</em> properties of the set's iterator.
* The created {@code Spliterator} additionally reports
* {@link Spliterator#SUBSIZED}.
*
* @return a {@code Spliterator} over the elements in this set
* @since 1.8
*/
@Override
public
Spliterator
<
E
>
spliterator
()
{
...
...
src/share/classes/java/util/LinkedList.java
浏览文件 @
0d80ac64
...
...
@@ -1149,6 +1149,23 @@ public class LinkedList<E>
linkLast
((
E
)
s
.
readObject
());
}
/**
* Creates a <em><a href="Spliterator.html#binding">late-binding</a></em>
* and <em>fail-fast</em> {@link Spliterator} over the elements in this
* list.
*
* <p>The {@code Spliterator} reports {@link Spliterator#SIZED} and
* {@link Spliterator#ORDERED}. Overriding implementations should document
* the reporting of additional characteristic values.
*
* @implNote
* The {@code Spliterator} additionally reports {@link Spliterator#SUBSIZED}
* and implements {@code trySplit} to permit limited parallelism..
*
* @return a {@code Spliterator} over the elements in this list
* @since 1.8
*/
@Override
public
Spliterator
<
E
>
spliterator
()
{
return
new
LLSpliterator
<
E
>(
this
,
-
1
,
0
);
}
...
...
src/share/classes/java/util/List.java
浏览文件 @
0d80ac64
...
...
@@ -671,7 +671,7 @@ public interface List<E> extends Collection<E> {
* The default implementation creates a
* <em><a href="Spliterator.html#binding">late-binding</a></em> spliterator
* from the list's {@code Iterator}. The spliterator inherits the
* <em>fail-fast</em> properties of the
collection
's iterator.
* <em>fail-fast</em> properties of the
list
's iterator.
*
* @implNote
* The created {@code Spliterator} additionally reports
...
...
src/share/classes/java/util/PriorityQueue.java
浏览文件 @
0d80ac64
...
...
@@ -795,6 +795,19 @@ public class PriorityQueue<E> extends AbstractQueue<E>
heapify
();
}
/**
* Creates a <em><a href="Spliterator.html#binding">late-binding</a></em>
* and <em>fail-fast</em> {@link Spliterator} over the elements in this
* queue.
*
* <p>The {@code Spliterator} reports {@link Spliterator#SIZED},
* {@link Spliterator#SUBSIZED}, and {@link Spliterator#NONNULL}.
* Overriding implementations should document the reporting of additional
* characteristic values.
*
* @return a {@code Spliterator} over the elements in this queue
* @since 1.8
*/
public
final
Spliterator
<
E
>
spliterator
()
{
return
new
PriorityQueueSpliterator
<
E
>(
this
,
0
,
-
1
,
0
);
}
...
...
src/share/classes/java/util/Set.java
浏览文件 @
0d80ac64
...
...
@@ -394,7 +394,7 @@ public interface Set<E> extends Collection<E> {
* The default implementation creates a
* <em><a href="Spliterator.html#binding">late-binding</a></em> spliterator
* from the set's {@code Iterator}. The spliterator inherits the
* <em>fail-fast</em> properties of the
collection
's iterator.
* <em>fail-fast</em> properties of the
set
's iterator.
*
* @implNote
* The created {@code Spliterator} additionally reports
...
...
src/share/classes/java/util/SortedSet.java
浏览文件 @
0d80ac64
...
...
@@ -238,7 +238,7 @@ public interface SortedSet<E> extends Set<E> {
* The default implementation creates a
* <em><a href="Spliterator.html#binding">late-binding</a></em> spliterator
* from the sorted set's {@code Iterator}. The spliterator inherits the
* <em>fail-fast</em> properties of the
collection
's iterator. The
* <em>fail-fast</em> properties of the
set
's iterator. The
* spliterator's comparator is the same as the sorted set's comparator.
*
* @implNote
...
...
src/share/classes/java/util/Spliterator.java
浏览文件 @
0d80ac64
...
...
@@ -74,7 +74,11 @@ import java.util.function.LongConsumer;
* source prior to binding are reflected when the Spliterator is traversed.
* After binding a Spliterator should, on a best-effort basis, throw
* {@link ConcurrentModificationException} if structural interference is
* detected. Spliterators that do this are called <em>fail-fast</em>.
* detected. Spliterators that do this are called <em>fail-fast</em>. The
* bulk traversal method ({@link #forEachRemaining forEachRemaining()}) of a
* Spliterator may optimize traversal and check for structural interference
* after all elements have been traversed, rather than checking per-element and
* failing immediately.
*
* <p>Spliterators can provide an estimate of the number of remaining elements
* via the {@link #estimateSize} method. Ideally, as reflected in characteristic
...
...
src/share/classes/java/util/TreeMap.java
浏览文件 @
0d80ac64
...
...
@@ -790,8 +790,19 @@ public class TreeMap<K,V>
/**
* Returns a {@link Set} view of the keys contained in this map.
* The set's iterator returns the keys in ascending order.
* The set is backed by the map, so changes to the map are
*
* <p>The set's iterator returns the keys in ascending order.
* The set's spliterator is
* <em><a href="Spliterator.html#binding">late-binding</a></em>,
* <em>fail-fast</em>, and additionally reports {@link Spliterator#SORTED}
* and {@link Spliterator#ORDERED} with an encounter order that is ascending
* key order. The spliterator's comparator (see
* {@link java.util.Spliterator#getComparator()}) is {@code null} if
* the tree map's comparator (see {@link #comparator()}) is {@code null}.
* Otherwise, the spliterator's comparator is the same as or imposes the
* same total ordering as the tree map's comparator.
*
* <p>The set is backed by the map, so changes to the map are
* reflected in the set, and vice-versa. If the map is modified
* while an iteration over the set is in progress (except through
* the iterator's own {@code remove} operation), the results of
...
...
@@ -823,9 +834,15 @@ public class TreeMap<K,V>
/**
* Returns a {@link Collection} view of the values contained in this map.
* The collection's iterator returns the values in ascending order
* of the corresponding keys.
* The collection is backed by the map, so changes to the map are
*
* <p>The collection's iterator returns the values in ascending order
* of the corresponding keys. The collection's spliterator is
* <em><a href="Spliterator.html#binding">late-binding</a></em>,
* <em>fail-fast</em>, and additionally reports {@link Spliterator#ORDERED}
* with an encounter order that is ascending order of the corresponding
* keys.
*
* <p>The collection is backed by the map, so changes to the map are
* reflected in the collection, and vice-versa. If the map is
* modified while an iteration over the collection is in progress
* (except through the iterator's own {@code remove} operation),
...
...
@@ -843,8 +860,15 @@ public class TreeMap<K,V>
/**
* Returns a {@link Set} view of the mappings contained in this map.
* The set's iterator returns the entries in ascending key order.
* The set is backed by the map, so changes to the map are
*
* <p>The set's iterator returns the entries in ascending key order. The
* sets's spliterator is
* <em><a href="Spliterator.html#binding">late-binding</a></em>,
* <em>fail-fast</em>, and additionally reports {@link Spliterator#SORTED} and
* {@link Spliterator#ORDERED} with an encounter order that is ascending key
* order.
*
* <p>The set is backed by the map, so changes to the map are
* reflected in the set, and vice-versa. If the map is modified
* while an iteration over the set is in progress (except through
* the iterator's own {@code remove} operation, or through the
...
...
src/share/classes/java/util/TreeSet.java
浏览文件 @
0d80ac64
...
...
@@ -533,6 +533,25 @@ public class TreeSet<E> extends AbstractSet<E>
tm
.
readTreeSet
(
size
,
s
,
PRESENT
);
}
/**
* Creates a <em><a href="Spliterator.html#binding">late-binding</a></em>
* and <em>fail-fast</em> {@link Spliterator} over the elements in this
* set.
*
* <p>The {@code Spliterator} reports {@link Spliterator#SIZED},
* {@link Spliterator#DISTINCT}, {@link Spliterator#SORTED}, and
* {@link Spliterator#ORDERED}. Overriding implementations should document
* the reporting of additional characteristic values.
*
* <p>The spliterator's comparator (see
* {@link java.util.Spliterator#getComparator()}) is {@code null} if
* the tree set's comparator (see {@link #comparator()}) is {@code null}.
* Otherwise, the spliterator's comparator is the same as or imposes the
* same total ordering as the tree set's comparator.
*
* @return a {@code Spliterator} over the elements in this set
* @since 1.8
*/
public
Spliterator
<
E
>
spliterator
()
{
return
TreeMap
.
keySpliteratorFor
(
m
);
}
...
...
src/share/classes/java/util/Vector.java
浏览文件 @
0d80ac64
...
...
@@ -1323,6 +1323,19 @@ public class Vector<E>
modCount
++;
}
/**
* Creates a <em><a href="Spliterator.html#binding">late-binding</a></em>
* and <em>fail-fast</em> {@link Spliterator} over the elements in this
* list.
*
* <p>The {@code Spliterator} reports {@link Spliterator#SIZED},
* {@link Spliterator#SUBSIZED}, and {@link Spliterator#ORDERED}.
* Overriding implementations should document the reporting of additional
* characteristic values.
*
* @return a {@code Spliterator} over the elements in this list
* @since 1.8
*/
@Override
public
Spliterator
<
E
>
spliterator
()
{
return
new
VectorSpliterator
<>(
this
,
null
,
0
,
-
1
,
0
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录