public class

FastLongSet

extends AbstractSet<E>
java.lang.Object
   ↳ java.util.AbstractCollection<E>
     ↳ java.util.AbstractSet<E>
       ↳ com.pnfsoftware.jeb.util.collect.FastLongSet

Class Overview

A (small) set of long values backed by a Bitmap for fast insertion/retrieval and zero allocation at run-time. The set range must not exceed 4G; the recommended max range should not exceed a few thousands.

Summary

Public Constructors
FastLongSet(long from, long to)
Create a set.
FastLongSet(long end)
Create a set for the range [0, end).
FastLongSet(FastLongSet set0)
Duplicate an existing set.
Public Methods
boolean add(Long e)
boolean addAll(Collection<? extends Long> c)
void addAllFast(FastLongSet other)
Fast version of addAll(Collection).
void clear()
boolean contains(Object o)
boolean containsAll(Collection<?> c)
boolean equals(Object obj)
int hashCode()
boolean isEmpty()
Iterator<Long> iterator()
boolean remove(Object o)
int size()
String toString()
[Expand]
Inherited Methods
From class java.util.AbstractSet
From class java.util.AbstractCollection
From class java.lang.Object
From interface java.lang.Iterable
From interface java.util.Collection
From interface java.util.Set

Public Constructors

public FastLongSet (long from, long to)

Create a set.

Parameters
from range start (inclusive)
to range end (exclusive)

public FastLongSet (long end)

Create a set for the range [0, end).

Parameters
end range end (exclusive)

public FastLongSet (FastLongSet set0)

Duplicate an existing set.

Parameters
set0 source set

Public Methods

public boolean add (Long e)

public boolean addAll (Collection<? extends Long> c)

public void addAllFast (FastLongSet other)

Fast version of addAll(Collection). Restrictions: the input collection must be a FastLongSet of the exact range.

public void clear ()

public boolean contains (Object o)

public boolean containsAll (Collection<?> c)

public boolean equals (Object obj)

public int hashCode ()

public boolean isEmpty ()

public Iterator<Long> iterator ()

public boolean remove (Object o)

public int size ()

public String toString ()