Package org.goplanit.utils.wrapper
Class LongMapWrapperImpl<V>
- java.lang.Object
-
- org.goplanit.utils.wrapper.MapWrapperImpl<Long,V>
-
- org.goplanit.utils.wrapper.LongMapWrapperImpl<V>
-
- Type Parameters:
V
- map value
- All Implemented Interfaces:
Iterable<V>
,LongMapWrapper<V>
,MapWrapper<Long,V>
- Direct Known Subclasses:
GraphEntitiesImpl
,ManagedIdEntitiesImpl
,ProjectDemands
,ProjectNetworks
,ProjectOdPathSets
,ProjectRoutedServices
,ProjectServiceNetworks
,ProjectZonings
public abstract class LongMapWrapperImpl<V> extends MapWrapperImpl<Long,V> implements LongMapWrapper<V>
Wrapper class for a map instance with Long keys- Author:
- markr
-
-
Constructor Summary
Constructors Constructor Description LongMapWrapperImpl(Map<Long,V> mapToWrap, Function<V,Long> valueToKey)
ConstructorLongMapWrapperImpl(LongMapWrapperImpl<V> other)
Copy constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(long key)
Verify if entry is presentV
get(long key)
Collect entry from container using primitiveV
remove(long key)
Remove value from map by the long keyabstract LongMapWrapperImpl<V>
shallowClone()
Each map wrapper should be cloneable where the contents are references of the original where possible but the underlying map itself is newly created-
Methods inherited from class org.goplanit.utils.wrapper.MapWrapperImpl
clear, containsValue, createEmptyInstance, firstMatch, get, getKeyByValue, getMap, getValueToKey, isEmpty, iterator, register, remove, removeIf, setMap, size, toCollection, valuesAsNewSet
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface org.goplanit.utils.wrapper.MapWrapper
addAll, clear, containsValue, firstMatch, forEachIn, get, getFirst, getKeyByValue, isEmpty, register, remove, removeAll, removeIf, size, stream, streamSorted, toCollection, toMap, valuesAsNewSet
-
-
-
-
Constructor Detail
-
LongMapWrapperImpl
public LongMapWrapperImpl(Map<Long,V> mapToWrap, Function<V,Long> valueToKey)
Constructor- Parameters:
mapToWrap
- the map to wrapvalueToKey
- function to map a value to its key
-
LongMapWrapperImpl
public LongMapWrapperImpl(LongMapWrapperImpl<V> other)
Copy constructor- Parameters:
other
- to copy
-
-
Method Detail
-
remove
public V remove(long key)
Remove value from map by the long key- Specified by:
remove
in interfaceLongMapWrapper<V>
- Parameters:
key
- to remove- Returns:
- removed entry if any
-
get
public V get(long key)
Collect entry from container using primitive- Specified by:
get
in interfaceLongMapWrapper<V>
- Parameters:
key
- to use- Returns:
- value found
-
containsKey
public boolean containsKey(long key)
Verify if entry is present- Specified by:
containsKey
in interfaceLongMapWrapper<V>
- Parameters:
key
- to use- Returns:
- true when present, false otherwise
-
shallowClone
public abstract LongMapWrapperImpl<V> shallowClone()
Each map wrapper should be cloneable where the contents are references of the original where possible but the underlying map itself is newly created- Specified by:
shallowClone
in interfaceMapWrapper<Long,V>
- Overrides:
shallowClone
in classMapWrapperImpl<Long,V>
- Returns:
- copy
-
-