Top Description Methods
com.carrotsearch.hppc

public Interface CharCollection

extends CharContainer
Known Direct Subinterfaces
com.carrotsearch.hppc.CharDeque, com.carrotsearch.hppc.CharSet, com.carrotsearch.hppc.CharIndexedContainer
Known Direct Implementers
com.carrotsearch.hppc.AbstractCharCollection
Annotations
@Generated:KTypeCollection.java
date:2024-06-04T15:20:17+0200
Imports
com.carrotsearch.hppc.predicates.CharPredicate

A collection allows basic, efficient operations on sets of elements (difference and intersection).

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Removes all elements from this collection.

public void
release()

Removes all elements from the collection and additionally releases any internal buffers.

public int

Returns:

The number of removed elements as a result of this call.
removeAll
(char
Element to be removed from this collection, if present.
e
)

Removes all occurrences of e from this collection.

public int

Returns:

Returns the number of removed elements.
removeAll
(CharLookupContainer c)

Removes all elements in this collection that are present in c.

public int

Returns:

Returns the number of removed elements.
removeAll
(CharPredicate predicate)

Removes all elements in this collection for which the given predicate returns true .

public int

Returns:

Returns the number of removed elements.
retainAll
(CharLookupContainer c)

Keeps all elements in this collection that are present in c.

public int

Returns:

Returns the number of removed elements.
retainAll
(CharPredicate predicate)

Keeps all elements in this collection for which the given predicate returns true.

Inherited from com.carrotsearch.hppc.CharContainer:
containsforEachforEachisEmptyiteratorsizetoArray

Method Detail

clearback to summary
public void clear()

Removes all elements from this collection.

See Also
release()
releaseback to summary
public void release()

Removes all elements from the collection and additionally releases any internal buffers. Typically, if the object is to be reused, a simple clear() should be a better alternative since it'll avoid reallocation.

See Also
clear()
removeAllback to summary
public int removeAll(char e)

Removes all occurrences of e from this collection.

Parameters
e:char

Element to be removed from this collection, if present.

Returns:int

The number of removed elements as a result of this call.

removeAllback to summary
public int removeAll(CharLookupContainer c)

Removes all elements in this collection that are present in c.

Returns:int

Returns the number of removed elements.

removeAllback to summary
public int removeAll(CharPredicate predicate)

Removes all elements in this collection for which the given predicate returns true .

Returns:int

Returns the number of removed elements.

retainAllback to summary
public int retainAll(CharLookupContainer c)

Keeps all elements in this collection that are present in c. Runs in time proportional to the number of elements in this collection. Equivalent of sets intersection.

Returns:int

Returns the number of removed elements.

retainAllback to summary
public int retainAll(CharPredicate predicate)

Keeps all elements in this collection for which the given predicate returns true.

Returns:int

Returns the number of removed elements.