it.unimi.di.mg4j.search
Class Index2IntervalIteratorMap

java.lang.Object
  extended by it.unimi.dsi.fastutil.objects.AbstractReference2ReferenceFunction<K,V>
      extended by it.unimi.dsi.fastutil.objects.AbstractReference2ReferenceMap<Index,IntervalIterator>
          extended by it.unimi.di.mg4j.search.Index2IntervalIteratorMap
All Implemented Interfaces:
Function<Index,IntervalIterator>, Reference2ReferenceFunction<Index,IntervalIterator>, Reference2ReferenceMap<Index,IntervalIterator>, Serializable, Map<Index,IntervalIterator>

public final class Index2IntervalIteratorMap
extends AbstractReference2ReferenceMap<Index,IntervalIterator>

A simple, brute-force implementation of a fixed-size map from indices to interval iterators based on two parallel backing arrays.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class it.unimi.dsi.fastutil.objects.AbstractReference2ReferenceMap
AbstractReference2ReferenceMap.BasicEntry<K,V>
 
Nested classes/interfaces inherited from interface it.unimi.dsi.fastutil.objects.Reference2ReferenceMap
Reference2ReferenceMap.Entry<K,V>, Reference2ReferenceMap.FastEntrySet<K,V>
 
Field Summary
protected  Index[] key
          The keys (valid up to size, excluded).
protected  int size
          The number of valid entries in key and value.
protected  IntervalIterator[] value
          The values (parallel to key).
 
Fields inherited from class it.unimi.dsi.fastutil.objects.AbstractReference2ReferenceFunction
defRetValue
 
Constructor Summary
Index2IntervalIteratorMap(Index2IntervalIteratorMap m)
          Creates a new empty array map copying the entries of a given map.
Index2IntervalIteratorMap(int capacity)
           
 
Method Summary
 void add(Index k, IntervalIterator v)
          A fast version of {put(Index, IntervalIterator) that does not return the previous value.
 void clear()
           
 boolean containsKey(Object k)
           
 boolean containsValue(Object v)
           
 void defaultReturnValue(IntervalIterator unused)
           
 IntervalIterator get(Object k)
           
 boolean isEmpty()
           
 ReferenceSet<Index> keySet()
           
 IntervalIterator put(Index k, IntervalIterator v)
           
 ObjectSet<Reference2ReferenceMap.Entry<Index,IntervalIterator>> reference2ReferenceEntrySet()
           
 IntervalIterator remove(Object k)
           
 int size()
           
 ReferenceCollection<IntervalIterator> values()
           
 
Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractReference2ReferenceMap
entrySet, equals, hashCode, putAll, toString
 
Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractReference2ReferenceFunction
defaultReturnValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface it.unimi.dsi.fastutil.objects.Reference2ReferenceFunction
defaultReturnValue
 

Field Detail

key

protected Index[] key
The keys (valid up to size, excluded).


value

protected IntervalIterator[] value
The values (parallel to key).


size

protected int size
The number of valid entries in key and value.

Constructor Detail

Index2IntervalIteratorMap

public Index2IntervalIteratorMap(int capacity)

Index2IntervalIteratorMap

public Index2IntervalIteratorMap(Index2IntervalIteratorMap m)
Creates a new empty array map copying the entries of a given map.

Parameters:
m - a map.
Method Detail

reference2ReferenceEntrySet

public ObjectSet<Reference2ReferenceMap.Entry<Index,IntervalIterator>> reference2ReferenceEntrySet()

get

public IntervalIterator get(Object k)

size

public int size()

clear

public void clear()
Specified by:
clear in interface Function<Index,IntervalIterator>
Specified by:
clear in interface Map<Index,IntervalIterator>
Overrides:
clear in class AbstractReference2ReferenceFunction<Index,IntervalIterator>

containsKey

public boolean containsKey(Object k)
Specified by:
containsKey in interface Function<Index,IntervalIterator>
Specified by:
containsKey in interface Map<Index,IntervalIterator>
Overrides:
containsKey in class AbstractReference2ReferenceMap<Index,IntervalIterator>

containsValue

public boolean containsValue(Object v)
Specified by:
containsValue in interface Map<Index,IntervalIterator>
Overrides:
containsValue in class AbstractReference2ReferenceMap<Index,IntervalIterator>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map<Index,IntervalIterator>
Overrides:
isEmpty in class AbstractReference2ReferenceMap<Index,IntervalIterator>

put

public IntervalIterator put(Index k,
                            IntervalIterator v)
Specified by:
put in interface Function<Index,IntervalIterator>
Specified by:
put in interface Map<Index,IntervalIterator>
Overrides:
put in class AbstractReference2ReferenceFunction<Index,IntervalIterator>

add

public void add(Index k,
                IntervalIterator v)
A fast version of {put(Index, IntervalIterator) that does not return the previous value.

Parameters:
k - the key.
v - the value.

remove

public IntervalIterator remove(Object k)
Specified by:
remove in interface Function<Index,IntervalIterator>
Specified by:
remove in interface Map<Index,IntervalIterator>
Overrides:
remove in class AbstractReference2ReferenceFunction<Index,IntervalIterator>

keySet

public ReferenceSet<Index> keySet()
Specified by:
keySet in interface Reference2ReferenceMap<Index,IntervalIterator>
Specified by:
keySet in interface Map<Index,IntervalIterator>
Overrides:
keySet in class AbstractReference2ReferenceMap<Index,IntervalIterator>

values

public ReferenceCollection<IntervalIterator> values()
Specified by:
values in interface Reference2ReferenceMap<Index,IntervalIterator>
Specified by:
values in interface Map<Index,IntervalIterator>
Overrides:
values in class AbstractReference2ReferenceMap<Index,IntervalIterator>

defaultReturnValue

public void defaultReturnValue(IntervalIterator unused)
Specified by:
defaultReturnValue in interface Reference2ReferenceFunction<Index,IntervalIterator>
Overrides:
defaultReturnValue in class AbstractReference2ReferenceFunction<Index,IntervalIterator>