Top Description Methods
com.carrotsearch.hppc

public Interface ShortSet

extends ShortCollection
Known Direct Implementers
com.carrotsearch.hppc.ShortHashSet
Annotations
@Generated:KTypeSet.java
date:2024-06-04T15:20:17+0200

A set of shorts.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

Returns true if this element was not part of the set before. Returns false if an equal element is already part of the set, does not replace the existing element with the argument.
add
(short k)

Adds k to the set.

public int

Returns:

Returns the number of elements actually added as a result of this call (not previously present in the set).
addAll
(ShortContainer container)

Adds all elements from the given ShortContainer to this set.

public String

Returns:

Returns a sequence of characters where '.' depicts an empty fragment of the internal buffer and 'X' depicts full or nearly full capacity within the buffer's range and anything between 1 and 9 is between.
visualizeKeyDistribution
(int
The number of characters to "squeeze" the entire buffer into.
characters
)

Visually depict the distribution of keys.

Inherited from com.carrotsearch.hppc.ShortCollection:
clearreleaseremoveAllremoveAllremoveAllretainAllretainAll

Method Detail

addback to summary
public boolean add(short k)

Adds k to the set.

Returns:boolean

Returns true if this element was not part of the set before. Returns false if an equal element is already part of the set, does not replace the existing element with the argument.

addAllback to summary
public int addAll(ShortContainer container)

Adds all elements from the given ShortContainer to this set.

Returns:int

Returns the number of elements actually added as a result of this call (not previously present in the set).

Since
0.9.1
visualizeKeyDistributionback to summary
public String visualizeKeyDistribution(int characters)

Visually depict the distribution of keys.

Parameters
characters:int

The number of characters to "squeeze" the entire buffer into.

Returns:String

Returns a sequence of characters where '.' depicts an empty fragment of the internal buffer and 'X' depicts full or nearly full capacity within the buffer's range and anything between 1 and 9 is between.