zoukankan      html  css  js  c++  java
  • Collection&Map


    1.Collection

    • 添加元素 boolean add(E e)
    • 删除元素 boolean remove(E e)
    • 元素个数 int size()
    • 清空 void clear()
    • 判空 boolean isEmpty()
    • 是否包含元素 boolean contains(Object o)
    • boolean containsAll()
    • Object[] toArray()
    • T[] toArray(T[] a)
    • 取交集 boolean retainAll(Collection<?> c)
    • 取差 boolean removeAll(Colllection<?> c)
    • 取并集(不去重) boolean addAll()

    Object

    • boolean equals(Object)
    • int hashcode()

    Iterable

    • 迭代器iterator()
    • spliterator()
    • removeIf()
    • stream()
    • parallelStream()

    1.1 List

    • void replaceAll()
    List<String> list=new ArrayList<String>();
    list.replaceAll(t->t+" ")
    
    • void sort(Comparable<? super E>)
    • E get(int)
    • E set(int, E)
    • void add(int, E)
    • 索引 int indexOf(Object)
    • int lastIndexOf(Object)
    • 截取列表 List subList(int,int)
    • ListIterator listIterator()
    • ListIterator listIterator(int)

    1.1.1 ArrayList

    1.1.2 LinkedList

    1.1.3 Vector

    1.1.4 Stack

    1.2 Set

    1.2.1 HashSet

    1.2.2 LinkedHashSet

    1.2.3 TreeSet

    1.3 Queue

    ...

    2.Map

    2.1 HashMap

    2.2 TreeMap

    2.3 HashTable

    2.4 LinkedHashMap

    2.5 CurrentHashMap

    Iterator、LinkIterator
    Collections、Arrays
    Comparable、Comparator

  • 相关阅读:
    Python学习 :面向对象 -- 三大特性
    Python学习 :面向对象(一)
    小米oj #40 找小“3”
    第三次作业
    排序算法模板
    树状数组求逆序数
    最短路模板
    字典树模板
    LCS
    多项式朴素乘法
  • 原文地址:https://www.cnblogs.com/mznsndy/p/12051779.html
Copyright © 2011-2022 走看看