RandomAccess is a marker interface. It doesn't define methods; instead, it identifies a class as having a particular capability.
According to the online document:
The primary purpose of this interface is to allow generic algorithms
to alter their behavior to provide good performance when applied to
either random or sequential access lists.
To be more specific, for typical instances of the class, this loop:
for (int i=0, n=list.size(); i < n; i++)
list.get(i);
runs faster than this loop:
for (Iterator i=list.iterator(); i.hasNext(); )
i.next();
The well-known implementing classes are:
ArrayList, Stack, Vector
分享到:
相关推荐
NULL 博文链接:https://lidongfu005.iteye.com/blog/2012223
下面小编就为大家带来一篇Java接口RandomAccess全面了解。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
主要介绍了java 中RandomAccess接口源码分析的相关资料,需要的朋友可以参考下
java 1.8 源码 jdk1.8.0_151-源码的中文翻译和一些自己的理解 声明 作者现在大四快要毕业,在实习中,为了在未来成为一名架构师,下定决心开始读Java的...RandomAccess.java ArrayList.java LinkedList.java Vector.jav
in Java), linked lists, stacks, queues, recursion, random numbers, files (text, binary, random access, indexed), binary trees, advanced sorting methods (heapsort, quicksort, mergesort, Shell sort), ...
The Sockets Direct Protocol (SDP) provides access to high performance network connections; see Understanding the Sockets Direct Protocol. Security A new native provider has been added that provides ...
1,methods for accessing file, text data, object ...Sequential and Random access 2,Reading and writing of primitive values 3,Applications and applets are provided with three streams automatically
15.3 通过randomaccess接口优化迭代列表 15.4 合并java中的多进程与系统优化 小结 附录a together工具的使用简介 附录b j2se 5.0的新特性与性能的提升 附录c 编排代码的精美工具jxbeauty 使用有道云笔记,轻松同步...
Apply advanced general purpose data structures, priority queue-based sorting, and random access immutable linked lists Gain a better understanding of the concept of graphs, directed and undirected ...
thousands of code snippets, hundreds of screenshots and ~1500 online references are provided to enable the utilization of this book as both a sequential tutorial and as a random-access reference ...
thousands of code snippets, hundreds of screenshots and ~1500 online references are provided to enable the utilization of this book as both a sequential tutorial and as a random-access reference ...
Code snippets, screenshots, and numerous online references are provided to enable the utilization of this book as both a sequential tutorial and as a random-access reference suited for immediate use....
Code snippets, screenshots, and numerous online references are provided to enable the utilization of this book as both a sequential tutorial and as a random-access reference suited for immediate use....
JavaCV also comes with helper classes and methods on top of OpenCV and FFmpeg to facilitate their integration to the Java platform. Here is a small demo program demonstrating the most frequently ...
thousands of code snippets, hundreds of screenshots and ~1500 online references are provided to enable the utilization of this book as both a sequential tutorial and as a random-access reference ...
概述 Java语言中,提供了一套数据集合框架,其中定义了一些诸如List、Set等抽象数据类型,每个抽象...1、顺序存储,Random Access(Direct Access): 这种方式,相邻的数据元素存放于相邻的内存地址中,整块内存地址
ArrayList集成AbstractList抽象类,实现了List、RandomAccess、Cloneable、java.io.Serializable这四个接口,其中我们可以看到,实现了Cloneable和Serializable接口就代表着ArrayList是支持克隆和序列化的,这里有个...
由上可知ArrayList继承AbstractList并且实现了List和RandomAccess,Cloneable,Serializable接口。①构造方法由上面三种构造方法可知,默认情况下使用ArrayList会生成一个大小为10的Object类型的数组。也可以调用...
Chapter 22Miscellaneous Utilitiescovers the rest of the utility classes such as bit sets, formatted output, text scanning, and random number generation. Chapter 23System Programmingleads you through ...
13.4Random类的使用402 13.5Date类和Calendar类的使用404 13.5.1Date类的简单使用404 13.5.2使用SimpleDateFormat格式化输出时间405 13.5.3Calendar类的特色408 13.5.4利用GregorianCalendar输出日历411 13.6...