站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JDK 5 Documentation v6.0, Java 2 SDK 英文文档

Collections Framework Change Summary for Java SE 6 - JDK 5 Documentation v6.0, Java 2 SDK 英文文档

Java

Collections Framework Enhancements

This page summarizes enhancements to the collections framework in Java SE 6.

This release saw fewer API changes than 5.0, but there was more of a focus on the accuracy and clarity of the specification. We recommend using the Java SE 6 specification even when writing programs for older releases.

The primary theme of the API changes was better bi-directional collection access.

These new collection interfaces are provided:

The following concrete implementation classes have been added:

These existing classes have been retrofitted to implement new interfaces:

Two new methods were added to the Collections utility class:

The Arrays utility class now has methods copyOf and copyOfRange that can efficiently resize, truncate, or copy subarrays for arrays of all types.

Before:

int[] newArray = new int[newLength];
System.arraycopy(oldArray, 0, newArray, 0, oldArray.length);

After:

int[] newArray = Arrays.copyOf(a, newLength);

Copyright © 2006 Sun Microsystems, Inc. All Rights Reserved.


Please send comments to: collections-comments@java.sun.com
Sun
Java Software