zoukankan      html  css  js  c++  java
  • java collections读书笔记(9)collection框架总览(2)

    框架算法:

    1)collection接口

    add()  Adds an element to the collection.
    addAll()  Adds a collection of elements to the collection.
    clear()  Clears all elements from the collection.
    contains()  Checks if a collection contains an element.
    containsAll()  Checks if a collection contains a collection of elements.
    equals()  Checks for equality with another object.
    hashCode()  Returns the computed hash code for the collection

    isEmpty()  Checks if a collection is empty.
    iterator()  Returns an object from the collection that allows all of the collection's elements to be visited.
    remove()  Clears a specific element from collection.
    removeAll()  Clears a collection of elements from the collection.
    retainAll()  Removes all elements from the collection not in another collection.
    size()  Returns the number of elements in the collection.
    toArray()  Returns the elements of a collection as an array.

    Iterator接口:

    interator接口是collection框架用来代替老的Enumeration接口的。

    提供了在collection中遍历元素的一个标准方式。

    hasNext()  Checks for more elements in the iterator.
    next()  Fetches the next element of the iterator.
    remove() Removes an element from the iterator.

  • 相关阅读:
    javaDSA实现加密和解密(签名和验证)
    javaRSA实现加密解密
    javaBase64加密解密
    javaApacheMd5AndSHA1加密
    javaDES加密算法
    javaSHA1实现加密解密
    Time dependent Entire Hierarchy
    BI的需求调研的方法分类
    BW Query Design中实现Key figure排序
    后勤模块PROCESS KEY 的激活及查看
  • 原文地址:https://www.cnblogs.com/aomi/p/3141485.html
Copyright © 2011-2022 走看看