it.unimi.di.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.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
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
.
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.
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>