Package it.unimi.di.big.mg4j.search
Class Index2IntervalIteratorMap
- java.lang.Object
-
- it.unimi.dsi.fastutil.objects.AbstractReference2ReferenceFunction<K,V>
-
- it.unimi.dsi.fastutil.objects.AbstractReference2ReferenceMap<Index,IntervalIterator>
-
- it.unimi.di.big.mg4j.search.Index2IntervalIteratorMap
-
- All Implemented Interfaces:
Function<Index,IntervalIterator>
,Reference2ReferenceFunction<Index,IntervalIterator>
,Reference2ReferenceMap<Index,IntervalIterator>
,Serializable
,Function<Index,IntervalIterator>
,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 extends Object,V extends Object>, AbstractReference2ReferenceMap.BasicEntrySet<K extends Object,V extends Object>
-
Nested classes/interfaces inherited from interface it.unimi.dsi.fastutil.objects.Reference2ReferenceMap
Reference2ReferenceMap.Entry<K extends Object,V extends Object>, Reference2ReferenceMap.FastEntrySet<K extends Object,V extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description protected Index[]
key
The keys (valid up tosize
, excluded).protected int
size
protected IntervalIterator[]
value
The values (parallel tokey
).-
Fields inherited from class it.unimi.dsi.fastutil.objects.AbstractReference2ReferenceFunction
defRetValue
-
-
Constructor Summary
Constructors Constructor Description Index2IntervalIteratorMap(int capacity)
Index2IntervalIteratorMap(Index2IntervalIteratorMap m)
Creates a new empty array map copying the entries of a given map.
-
Method Summary
Modifier and Type Method Description 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
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 java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Methods inherited from interface it.unimi.dsi.fastutil.objects.Reference2ReferenceMap
defaultReturnValue, entrySet
-
-
-
-
Field Detail
-
value
protected IntervalIterator[] value
The values (parallel tokey
).
-
size
protected int size
-
-
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()
-
containsKey
public boolean containsKey(Object k)
- Specified by:
containsKey
in interfaceFunction<Index,IntervalIterator>
- Specified by:
containsKey
in interfaceMap<Index,IntervalIterator>
- Specified by:
containsKey
in interfaceReference2ReferenceMap<Index,IntervalIterator>
- Overrides:
containsKey
in classAbstractReference2ReferenceMap<Index,IntervalIterator>
-
containsValue
public boolean containsValue(Object v)
- Specified by:
containsValue
in interfaceMap<Index,IntervalIterator>
- Overrides:
containsValue
in classAbstractReference2ReferenceMap<Index,IntervalIterator>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceMap<Index,IntervalIterator>
- Overrides:
isEmpty
in classAbstractReference2ReferenceMap<Index,IntervalIterator>
-
put
public IntervalIterator put(Index k, IntervalIterator v)
-
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)
-
keySet
public ReferenceSet<Index> keySet()
- Specified by:
keySet
in interfaceMap<Index,IntervalIterator>
- Specified by:
keySet
in interfaceReference2ReferenceMap<Index,IntervalIterator>
- Overrides:
keySet
in classAbstractReference2ReferenceMap<Index,IntervalIterator>
-
values
public ReferenceCollection<IntervalIterator> values()
- Specified by:
values
in interfaceMap<Index,IntervalIterator>
- Specified by:
values
in interfaceReference2ReferenceMap<Index,IntervalIterator>
- Overrides:
values
in classAbstractReference2ReferenceMap<Index,IntervalIterator>
-
defaultReturnValue
public void defaultReturnValue(IntervalIterator unused)
- Specified by:
defaultReturnValue
in interfaceReference2ReferenceFunction<Index,IntervalIterator>
- Specified by:
defaultReturnValue
in interfaceReference2ReferenceMap<Index,IntervalIterator>
- Overrides:
defaultReturnValue
in classAbstractReference2ReferenceFunction<Index,IntervalIterator>
-
-