Top Description Inners Fields Constructors Methods
org.lwjgl.opencl

pack-priv final Class FastLongMap<V>

extends Object
implements Iterable<FastLongMap.Entry<V>>
Class Inheritance
All Implemented Interfaces
java.lang.Iterable
Imports
java.util.Iterator

A hash map using primitive longs as keys rather than objects.
Authors
Justin Couch, Alex Chaffee ([email protected]), Stephen Colebourne, Nathan Sweet

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
public class

Field Summary

Modifier and TypeField and Description
private int
private int
private int
private FastLongMap.Entry<T>[]
private int

Constructor Summary

AccessConstructor and Description
pack-priv
FastLongMap()

Same as: FastLongMap(16, 0.75f);

pack-priv
FastLongMap(int initialCapacity)

Same as: FastLongMap(initialCapacity, 0.75f);

pack-priv
FastLongMap(int initialCapacity, float loadFactor)

Method Summary

Modifier and TypeMethod and Description
public void
public boolean
containsKey(long key)

public boolean
public V
get(long key)

private int
index(final long key)

private static int
index(final long key, final int mask)

public boolean
public FastLongMap<V>.EntryIterator
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.
public V
put(long key, V value)

private void
rehash(final FastLongMap.Entry<V>[] table)

public V
remove(long key)

public int
size()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

capacityback to summary
private int capacity
maskback to summary
private int mask
sizeback to summary
private int size
tableback to summary
private FastLongMap.Entry<T>[] table
thresholdback to summary
private int threshold

Constructor Detail

FastLongMapback to summary
pack-priv FastLongMap()

Same as: FastLongMap(16, 0.75f);

FastLongMapback to summary
pack-priv FastLongMap(int initialCapacity)

Same as: FastLongMap(initialCapacity, 0.75f);

FastLongMapback to summary
pack-priv FastLongMap(int initialCapacity, float loadFactor)

Method Detail

clearback to summary
public void clear()
containsKeyback to summary
public boolean containsKey(long key)
containsValueback to summary
public boolean containsValue(Object value)
getback to summary
public V get(long key)
indexback to summary
private int index(final long key)
indexback to summary
private static int index(final long key, final int mask)
isEmptyback to summary
public boolean isEmpty()
iteratorback to summary
public FastLongMap<V>.EntryIterator iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:FastLongMap<V>.EntryIterator

an Iterator.

putback to summary
public V put(long key, V value)
rehashback to summary
private void rehash(final FastLongMap.Entry<V>[] table)
removeback to summary
public V remove(long key)
sizeback to summary
public int size()
org.lwjgl.opencl back to summary

pack-priv final Class FastLongMap.Entry<T>

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final long
pack-priv FastLongMap.Entry<T>
pack-priv T

Constructor Summary

AccessConstructor and Description
pack-priv
Entry(long key, T value, FastLongMap.Entry<T> next)

Method Summary

Modifier and TypeMethod and Description
public long
public T
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

keyback to summary
pack-priv final long key
nextback to summary
pack-priv FastLongMap.Entry<T> next
valueback to summary
pack-priv T value

Constructor Detail

Entryback to summary
pack-priv Entry(long key, T value, FastLongMap.Entry<T> next)

Method Detail

getKeyback to summary
public long getKey()
getValueback to summary
public T getValue()
org.lwjgl.opencl back to summary

public Class FastLongMap.EntryIterator

extends Object
implements Iterator<FastLongMap.Entry<V>>
Class Inheritance
All Implemented Interfaces
java.util.Iterator

Field Summary

Modifier and TypeField and Description
private FastLongMap.Entry<V>
private int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.
public FastLongMap.Entry<V>
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.
public void
remove()

Overrides default java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation).
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentback to summary
private FastLongMap.Entry<V> current
nextIndexback to summary
private int nextIndex

Constructor Detail

EntryIteratorback to summary
pack-priv EntryIterator()

Method Detail

hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns:boolean

true if the iteration has more elements

nextback to summary
public FastLongMap.Entry<V> next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Returns:FastLongMap.Entry<V>

the next element in the iteration

removeback to summary
public void remove()

Overrides default java.util.Iterator.remove.

Doc from java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation). This method can be called only once per call to next.

The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.

The behavior of an iterator is unspecified if this method is called after a call to the forEachRemaining method.

resetback to summary
public void reset()