1. Iterator Declaration



Yüklə 56 Kb.
səhifə2/3
tarix22.07.2023
ölçüsü56 Kb.
#137103
1   2   3
Modifier and Type

Method

Description

boolean

add(E e)

Ensures that this collection contains the specified element (optional operation).

boolean

addAll(Collection c)

Adds all of the elements in the specified collection to this collection (optional operation).

void

clear()

Removes all of the elements from this collection (optional operation).

boolean

contains(Object o)

Returns true if this collection contains the specified element.

boolean

containsAll(Collection c)

Returns true if this collection contains all of the elements in the specified collection.

boolean

equals(Object o)

Compares the specified object with this collection for equality.

int

hashCode()

Returns the hash code value for this collection.

boolean

isEmpty()

Returns true if this collection contains no elements.

Iterator

iterator()

Returns an iterator over the elements in this collection.

default Stream

parallelStream()

Returns a possibly parallel Stream with this collection as its source.

boolean

remove(Object o)

Removes a single instance of the specified element from this collection, if it is present (optional operation).

boolean

removeAll(Collection c)

Removes all of this collection’s elements that are also contained in the specified collection (optional operation).

default boolean

removeIf(Predicate filter)

Removes all of the elements of this collection that satisfy the given predicate.

boolean

retainAll(Collection c)

Retains only the elements in this collection that are contained in the specified collection (optional operation).

int

size()

Returns the number of elements in this collection.

default Spliterator

spliterator()

Creates a Spliterator over the elements in this collection.

default Stream

stream()

Returns a sequential Stream with this collection as its source.

Object[]

toArray()

Returns an array containing all of the elements in this collection.

T[]

toArray(T[] a)

Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.


Yüklə 56 Kb.

Dostları ilə paylaş:
1   2   3




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin