Top Description Inners Fields Constructors Methods
org.lwjgl.opengl

pack-priv final Class FastIntMap<V>

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

A hash map using primitive ints 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 FastIntMap.Entry<T>[]
private int

Constructor Summary

AccessConstructor and Description
pack-priv
FastIntMap()

Same as: FastIntMap(16, 0.75f);

pack-priv
FastIntMap(int initialCapacity)

Same as: FastIntMap(initialCapacity, 0.75f);

pack-priv
FastIntMap(int initialCapacity, float loadFactor)

Method Summary

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

public boolean
public V
get(int key)

private int
index(final int key)

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

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

Implements java.lang.Iterable.iterator.

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

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

public V
remove(int 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 FastIntMap.Entry<T>[] table
thresholdback to summary
private int threshold

Constructor Detail

FastIntMapback to summary
pack-priv FastIntMap()

Same as: FastIntMap(16, 0.75f);

FastIntMapback to summary
pack-priv FastIntMap(int initialCapacity)

Same as: FastIntMap(initialCapacity, 0.75f);

FastIntMapback to summary
pack-priv FastIntMap(int initialCapacity, float loadFactor)

Method Detail

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

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:FastIntMap<V>.EntryIterator

an Iterator.

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

pack-priv final Class FastIntMap.Entry<T>

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final int
pack-priv FastIntMap.Entry<T>
pack-priv T

Constructor Summary

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

Method Summary

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

Field Detail

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

Constructor Detail

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

Method Detail

getKeyback to summary
public int getKey()
getValueback to summary
public T getValue()
org.lwjgl.opengl back to summary

public Class FastIntMap.EntryIterator

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

Field Summary

Modifier and TypeField and Description
private FastIntMap.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 FastIntMap.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 FastIntMap.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 FastIntMap.Entry<V> next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Returns:FastIntMap.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()