Package org.apache.lucene.sandbox.search
Class LongHashSet
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<java.lang.Long>
-
- org.apache.lucene.sandbox.search.LongHashSet
-
- All Implemented Interfaces:
java.lang.Iterable<java.lang.Long>
,java.util.Collection<java.lang.Long>
,java.util.Set<java.lang.Long>
,Accountable
final class LongHashSet extends java.util.AbstractSet<java.lang.Long> implements Accountable
-
-
Field Summary
Fields Modifier and Type Field Description private static long
BASE_RAM_BYTES
(package private) int
hashCode
(package private) boolean
hasMissingValue
(package private) int
mask
private static long
MISSING
(package private) int
size
(package private) long[]
table
-
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
-
Constructor Summary
Constructors Constructor Description LongHashSet(long... values)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
add(long l)
(package private) boolean
contains(long l)
boolean
contains(java.lang.Object o)
boolean
equals(java.lang.Object obj)
int
hashCode()
java.util.Iterator<java.lang.Long>
iterator()
long
ramBytesUsed()
Return the memory usage of this object in bytes.int
size()
-
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
-
-
-
Field Detail
-
BASE_RAM_BYTES
private static final long BASE_RAM_BYTES
-
MISSING
private static final long MISSING
- See Also:
- Constant Field Values
-
table
final long[] table
-
mask
final int mask
-
hasMissingValue
final boolean hasMissingValue
-
size
final int size
-
hashCode
final int hashCode
-
-
Method Detail
-
add
private boolean add(long l)
-
contains
boolean contains(long l)
-
size
public int size()
- Specified by:
size
in interfacejava.util.Collection<java.lang.Long>
- Specified by:
size
in interfacejava.util.Set<java.lang.Long>
- Specified by:
size
in classjava.util.AbstractCollection<java.lang.Long>
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejava.util.Collection<java.lang.Long>
- Specified by:
hashCode
in interfacejava.util.Set<java.lang.Long>
- Overrides:
hashCode
in classjava.util.AbstractSet<java.lang.Long>
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equals
in interfacejava.util.Collection<java.lang.Long>
- Specified by:
equals
in interfacejava.util.Set<java.lang.Long>
- Overrides:
equals
in classjava.util.AbstractSet<java.lang.Long>
-
ramBytesUsed
public long ramBytesUsed()
Description copied from interface:Accountable
Return the memory usage of this object in bytes. Negative values are illegal.- Specified by:
ramBytesUsed
in interfaceAccountable
-
contains
public boolean contains(java.lang.Object o)
- Specified by:
contains
in interfacejava.util.Collection<java.lang.Long>
- Specified by:
contains
in interfacejava.util.Set<java.lang.Long>
- Overrides:
contains
in classjava.util.AbstractCollection<java.lang.Long>
-
iterator
public java.util.Iterator<java.lang.Long> iterator()
- Specified by:
iterator
in interfacejava.util.Collection<java.lang.Long>
- Specified by:
iterator
in interfacejava.lang.Iterable<java.lang.Long>
- Specified by:
iterator
in interfacejava.util.Set<java.lang.Long>
- Specified by:
iterator
in classjava.util.AbstractCollection<java.lang.Long>
-
-